mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-08-03 13:12:16 +02:00
initial import
This commit is contained in:
5
microservices/gorilla-mux/go.mod
Normal file
5
microservices/gorilla-mux/go.mod
Normal file
@ -0,0 +1,5 @@
|
||||
module golang.source-fellows.com/samples/gorillamux
|
||||
|
||||
go 1.13
|
||||
|
||||
require github.com/gorilla/mux v1.7.4
|
2
microservices/gorilla-mux/go.sum
Normal file
2
microservices/gorilla-mux/go.sum
Normal 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=
|
18
microservices/gorilla-mux/main.go
Normal file
18
microservices/gorilla-mux/main.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user