Last active
August 5, 2019 18:56
-
-
Save johan-lejdung/08f97e231405d728bdd6bd97cfb515be 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/gorilla/mux" | |
"github.com/urfave/negroni" | |
) | |
func main() { | |
router := mux.NewRouter() | |
router. | |
Methods("GET"). | |
Path("/"). | |
HandlerFunc(endpointHandler) | |
n := negroni.New() | |
n.UseHandler(router) | |
err := http.ListenAndServe(":8080", n) | |
if err != nil { | |
panic(err) | |
} | |
} | |
func endpointHandler(w http.ResponseWriter, r *http.Request) { | |
fmt.Println("Endpoint handler called") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment