Skip to content

Instantly share code, notes, and snippets.

@lijiansong
Created January 14, 2018 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lijiansong/f2a2f77b90c60dcfbd1770e0fc542d0c to your computer and use it in GitHub Desktop.
Save lijiansong/f2a2f77b90c60dcfbd1770e0fc542d0c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
"github.com/urfave/negroni"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "Welcome to the home page!")
})
n := negroni.New()
n.Use(negroni.NewLogger())
n.UseHandler(mux)
http.ListenAndServe(":3004", n)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment