Goji是一个非常小型的Go语言的Web开发框架,灵感来自于Sinatra
示例代码:
package mainimport ( "fmt" "net/http" "github.com/zenazn/goji" "github.com/zenazn/goji/web")func hello(c web.C, w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, %s!", c.URLParams["name"])}func main() { goji.Get("/hello/:name", hello) goji.Serve()}
评论