mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
OK, my dream-idea is implemented. TODO: Some examples and doc.go is not updated yet, comments on the mvc/di subpackage, the tutorial/vuejs-todo-mvc is running but not finished yet (it's using browser's localstorage and it should be replaced by the http requests that are registered via iris mvc
Former-commit-id: 0ea7e01ce1d78bcb78b40f3b0f5c03ad7c9abaea
This commit is contained in:
1
_examples/tutorial/vuejs-todo-mvc/README.md
Normal file
1
_examples/tutorial/vuejs-todo-mvc/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# Unfinished - wait until today :)
|
||||
@@ -4,8 +4,9 @@ import (
|
||||
"github.com/kataras/iris/_examples/tutorial/vuejs-todo-mvc/src/todo"
|
||||
|
||||
"github.com/kataras/iris"
|
||||
mvc "github.com/kataras/iris/mvc2"
|
||||
"github.com/kataras/iris/sessions"
|
||||
|
||||
"github.com/kataras/iris/mvc"
|
||||
)
|
||||
|
||||
// TodoController is our TODO app's web controller.
|
||||
@@ -38,10 +39,6 @@ func (c *TodoController) BeforeActivate(ca *mvc.ControllerActivator) {
|
||||
})
|
||||
|
||||
// ca.Router.Use(...).Done(...).Layout(...)
|
||||
// TODO:(?)
|
||||
// m := ca.Method("PutCompleteBy")
|
||||
// m.Route.Use(...).Done(...) <- we don't have the route here but I can find something to solve this.
|
||||
// m.Dependencies.Add(...)
|
||||
}
|
||||
|
||||
// Get handles the GET: /todo route.
|
||||
|
||||
@@ -5,8 +5,9 @@ import (
|
||||
"github.com/kataras/iris/_examples/tutorial/vuejs-todo-mvc/src/web/controllers"
|
||||
|
||||
"github.com/kataras/iris"
|
||||
mvc "github.com/kataras/iris/mvc2"
|
||||
"github.com/kataras/iris/sessions"
|
||||
|
||||
"github.com/kataras/iris/mvc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -22,14 +23,16 @@ func main() {
|
||||
Cookie: "_iris_session",
|
||||
})
|
||||
|
||||
m := mvc.New()
|
||||
m := mvc.New(app.Party("/todo"))
|
||||
|
||||
// any bindings here...
|
||||
m.Bind(mvc.Session(sess))
|
||||
// any dependencies bindings here...
|
||||
m.AddDependencies(
|
||||
mvc.Session(sess),
|
||||
new(todo.MemoryService),
|
||||
)
|
||||
|
||||
m.Bind(new(todo.MemoryService))
|
||||
// controllers registration here...
|
||||
m.Controller(app.Party("/todo"), new(controllers.TodoController))
|
||||
m.Register(new(controllers.TodoController))
|
||||
|
||||
// start the web server at http://localhost:8080
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutVersionChecker, iris.WithOptimizations)
|
||||
|
||||
Reference in New Issue
Block a user