ns := beego.NewNamespace("/v1/api/")
ns.Cond(func(ctx *context.Context)bool{
if ctx.Input.Domain() == "www.beego.me" {
return true
}
return false
})
.Filter("before", Authenticate)
.Router("/order", &admin.OrderController{})
.Get("/version",func (ctx *context.Context) {
ctx.Output.Body([]byte("1.0.0"))
})
.Post("/login",func (ctx *context.Context) {
if ctx.Query("username") == "admin" && ctx.Query("username") ==
"password" {
}
})
.Namespace(
NewNamespace("/shop").
Get("/order/:id", func(ctx *context.Context) {
ctx.Output.Body([]byte(ctx.Input.Param(":id")))
}),
)
beego
beego is a Go Framework inspired by tornado and sinatra.
It is a simple & powerful web framework.
More info beego.me
Features
- RESTful support
- MVC architecture
- Session support (store in memory, file, Redis or MySQL)
- Cache support (store in memory, Redis or Memcache)
- Global Config
- Intelligent routing
- Thread-safe map
- Friendly displaying of errors
- Useful template functions
Documentation
LICENSE
beego is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
[
][koding]
[koding]: https://koding.com/Teamwork?import=https://github.com/astaxie/beego/archive/master.zip&c=git1
Description
