initial import

This commit is contained in:
SourceFellows
2020-08-21 06:26:40 +02:00
commit e223458dd4
423 changed files with 9871 additions and 0 deletions

View File

@ -0,0 +1,5 @@
module golang.source-fellows.com/samples/gorillamux
go 1.13
require github.com/gorilla/mux v1.7.4

View File

@ -0,0 +1,2 @@
github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

View File

@ -0,0 +1,18 @@
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)
}