gobuch/microservices/gorilla-mux/main.go
2020-08-21 06:26:40 +02:00

19 lines
285 B
Go

package main
import (
"net/http"
"github.com/gorilla/mux"
)
func myFunc(rw http.ResponseWriter, rq *http.Request) {
rw.Write([]byte("Hello World"))
}
func main() {
r := mux.NewRouter()
r.PathPrefix("/").HandlerFunc(myFunc)
r.Methods("GET")
http.ListenAndServe(":8080", r)
}