mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
one for today, one for tomorrow and ready :)
Former-commit-id: 2e0a335c84c1d9c57a61b7f3203e54f7cccd7dcc
This commit is contained in:
@@ -32,17 +32,25 @@ func TodoApp(app *mvc.Application) {
|
||||
&prefixedLogger{prefix: "DEV"},
|
||||
)
|
||||
|
||||
// GET: http://localhost:8080/todo
|
||||
// GET: http://localhost:8080/todo/custom
|
||||
app.Handle(new(TodoController))
|
||||
|
||||
// All dependencies of the parent *mvc.Application
|
||||
// are cloned to that new child, thefore it has access to the same session as well.
|
||||
// are cloned to this new child,
|
||||
// thefore it has access to the same session as well.
|
||||
// GET: http://localhost:8080/todo/sub
|
||||
app.Party("/sub").
|
||||
Handle(new(TodoSubController))
|
||||
}
|
||||
|
||||
// If controller's fields (or even its functions) expecting an interface
|
||||
// but a struct value is binded then it will check if that struct value implements
|
||||
// the interface and if true then it will bind it as expected.
|
||||
// but a struct value is binded then it will check
|
||||
// if that struct value implements
|
||||
// the interface and if true then it will add this to the
|
||||
// available bindings, as expected, before the server ran of course,
|
||||
// remember? Iris always uses the best possible way to reduce load
|
||||
// on serving web resources.
|
||||
|
||||
type LoggerService interface {
|
||||
Log(string)
|
||||
|
||||
@@ -65,7 +65,7 @@ func (c *websocketController) update() {
|
||||
// visits++
|
||||
newCount := increment()
|
||||
|
||||
// This will call the "visit" event on all clients, incuding the current
|
||||
// This will call the "visit" event on all clients, including the current
|
||||
// with the 'newCount' variable.
|
||||
//
|
||||
// There are many ways that u can do it and faster, for example u can just send a new visitor
|
||||
|
||||
Reference in New Issue
Block a user