Beego
官方网站
项目地址
快速开始
最后更新于
go get -u -v github.com/astaxie/beegopackage main
import (
"github.com/astaxie/beego"
)
type HelloController struct {
beego.Controller
}
func (c HelloController) SayHello() {
c.SetData(map[string]string{"say": "hello"})
c.ServeJSON()
}
func main() {
beego.Router("/hello", &HelloController{}, "get:SayHello")
beego.Run("localhost:8080")
}{"say":"hello"}