Esempio n. 1
0
func main() {
	pub := &Pub{relay.NewController("")}

	routes := relay.NewRoutes("")

	routes.RouteGET("/", pub.BindHTTP("", "/", pub.Index))
	http.ListenAndServe(":3030", routes)
}
Esempio n. 2
0
// NewTodoController returns a new TodoController
func NewTodoController(path string, db TodoDatabase, app *engine.Engine) *TodoController {
	tc := &TodoController{
		Controller: relay.NewController(path),
		db:         db,
	}

	tc.home = app.Template.MustCreate("home.render", []string{"./home", "./layout"}, nil)

	tc.register()
	return tc
}