ThinkGo 是一个轻量级的Go语言MVC框架,目前支持路由、中间件、控制器、请求、响应、Session、视图、日志等web框架应该具备的基本功能,致力于让代码简洁、富于表达力,帮助开发者快速构建一个Web应用。
go get -u github.com/thinkoner/thinkgo
package main import ( "github.com/thinkoner/thinkgo" "fmt" "github.com/thinkoner/thinkgo/router" "github.com/thinkoner/thinkgo/context" ) func main() { app := thinkgo.BootStrap() app.RegisterRoute(func(route *router.Route) { route.Get("/", func(req *context.Request) *context.Response { return thinkgo.Text("Hello ThinkGo !") }) route.Get("/ping", func(req *context.Request) *context.Response { return thinkgo.Json(map[string]string{ "message": "pong", }) }) // Dependency injection route.Get("/user/{name}", func(req *context.Request, name string) *context.Response { return thinkgo.Text(fmt.Sprintf("Hello %s !", name)) }) }) // listen and serve on 0.0.0.0:9011 app.Run() }
详细版本发布信息:https://github.com/thinkoner/thinkgo/releases
路由前缀、路由分组
路由中间件
GitHub:https://github.com/thinkoner/thinkgo
Gitee:https://gitee.com/thinkgo/thinkgo
2KB项目(www.2kb.com,源码交易平台),提供担保交易、源码交易、虚拟商品、在家创业、在线创业、任务交易、网站设计、软件设计、网络兼职、站长交易、域名交易、链接买卖、网站交易、广告买卖、站长培训、建站美工等服务