Skip to content

Instantly share code, notes, and snippets.

@iamjjanga-ouo
Last active March 19, 2021 08:30
Show Gist options
  • Save iamjjanga-ouo/a1f111b47870d0b63b17c273e384dd90 to your computer and use it in GitHub Desktop.
Save iamjjanga-ouo/a1f111b47870d0b63b17c273e384dd90 to your computer and use it in GitHub Desktop.
GoWeb: basic: install gin(hot reload module)
// 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