Created
January 14, 2018 08:20
-
-
Save lijiansong/f2a2f77b90c60dcfbd1770e0fc542d0c to your computer and use it in GitHub Desktop.
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
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