Last active
March 19, 2021 08:30
-
-
Save iamjjanga-ouo/a1f111b47870d0b63b17c273e384dd90 to your computer and use it in GitHub Desktop.
GoWeb: basic: install gin(hot reload module)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gin? | |
// gin is a simple command line utility for live-reloading Go web applications. | |
// install : `go get github.com/codegangsta/gin` | |
// usage : gin --all -i run main.go | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
type MyWebserverType bool | |
func (m MyWebserverType) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, ` | |
<!DOCTYPE html> | |
<html> | |
<head> | |
Hi | |
</head> | |
<body> | |
<h1>My name is Iamjjanga!</h1> | |
<p> gin is installed now</p> | |
</body> | |
</html> | |
`) | |
} | |
func main() { | |
var k MyWebserverType | |
http.ListenAndServe("localhost:8080", k) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment