mirror of
https://github.com/SourceFellows/gobuch.git
synced 2024-10-22 22:05:35 +00:00
17 lines
311 B
Go
17 lines
311 B
Go
package main
|
|
|
|
import "net/http"
|
|
|
|
func myHandler(res http.ResponseWriter, req *http.Request) {
|
|
if req.Method == http.MethodGet {
|
|
res.Write([]byte("Hello World"))
|
|
} else {
|
|
res.WriteHeader(http.StatusMethodNotAllowed)
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
http.HandleFunc("/", myHandler)
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|