初学者指南
Last updated
Was this helpful?
Was this helpful?
[Macaron] listening on 0.0.0.0:4000 (development)package main
import (
"log"
"net/http"
"gopkg.in/macaron.v1"
)
func main() {
m := macaron.Classic()
m.Get("/", myHandler)
log.Println("Server is running...")
log.Println(http.ListenAndServe("0.0.0.0:4000", m))
}
func myHandler(ctx *macaron.Context) string {
return "the request path is: " + ctx.Req.RequestURI
}