mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
finish the first state of the vuejs todo mvc example, a simple rest api - todo: websocket and live updates between browser tabs with the same session id
Former-commit-id: 0bd859420cff87014479c44a471ec273c621c1a2
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
// DELETE /users/{id:long} | delete by id
|
||||
// Requires basic authentication.
|
||||
type UsersController struct {
|
||||
// context is auto-binded by Iris on each request,
|
||||
// Optionally: context is auto-binded by Iris on each request,
|
||||
// remember that on each incoming request iris creates a new UserController each time,
|
||||
// so all fields are request-scoped by-default, only dependency injection is able to set
|
||||
// custom fields like the Service which is the same for all requests (static binding).
|
||||
@@ -84,5 +84,5 @@ func (c *UsersController) DeleteBy(id int64) interface{} {
|
||||
// right here we can see that a method function
|
||||
// can return any of those two types(map or int),
|
||||
// we don't have to specify the return type to a specific type.
|
||||
return 400 // same as `iris.StatusBadRequest`.
|
||||
return iris.StatusBadRequest // same as 400.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user