We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to implement RESTful API. But the following Beego code cannot make it.
POST /events/ GET /events/:slug GET /events/:id POST /events/:slug/sessions/ GET /events/:slug/sessions/:id
Please reference to the source code at: https://github.com/dwarvesf/liulo/blob/4def0c9f879dc2d855697952208cc42c3dcdb34b/routers/router.go
package routers import ( "github.com/astaxie/beego" "github.com/dwarvesf/liulo/controllers" ) func init() { beego.Router("/", &controllers.MainController{}) ns := beego.NewNamespace("/v1", // Authentication beego.NSNamespace("/users", beego.NSRouter("/sign_up", &controllers.UserController{}, "POST:SignUp"), beego.NSRouter("/sign_in", &controllers.UserController{}, "POST:SignIn"), beego.NSRouter("/", &controllers.UserController{}, "GET:GetCurrentUser"), ), // Events beego.NSNamespace("/events", beego.NSRouter("/", &controllers.EventController{}, "POST:Post"), beego.NSRouter("/:slug", &controllers.EventController{}, "GET:GetBySlug"), beego.NSRouter("/:eventId", &controllers.EventController{}, "GET:GetById"), ), // Sessions beego.NSNamespace("/events/:slug:string/sessions", beego.NSRouter("/", &controllers.SessionController{}, "GET:GetAll;POST:Post"), beego.NSRouter("/:sessionId", &controllers.SessionController{}, "GET:GetById"), ), beego.NSNamespace("/events/:slug:string/sessions/:sessionId/questions", beego.NSRouter("/", &controllers.QuestionController{}, "GET:GetAll;POST:Post"), beego.NSRouter("/:questionId", &controllers.QuestionController{}, "GET:GetById"), ), ) beego.AddNamespace(ns) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to implement RESTful API. But the following Beego code cannot make it.
Please reference to the source code at: https://github.com/dwarvesf/liulo/blob/4def0c9f879dc2d855697952208cc42c3dcdb34b/routers/router.go
The text was updated successfully, but these errors were encountered: