gobuch/microservices/gorilla-mux/main.go

19 lines
285 B
Go
Raw Normal View History

2020-08-21 04:26:40 +00:00
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)
}