func InitRoutes(m *martini.ClassicMartini) { m.Get("/", ListBlogs) m.Get("/new", NewBlog) m.Post("/new", binding.Form(models.Post{}), CreateBlog) m.Get("/post/:id", ShowBlog) m.NotFound(func(r render.Render) { fmt.Println("....................................................") r.HTML(404, "status/404", "") }) }
func Configure(m *martini.ClassicMartini) { m.Group("/humidity", func(r martini.Router) { r.Post("", humidity.Post) r.Get("", humidity.Get) }) m.Get("/current/humidity", current_humidity.Get) m.Group("/", func(r martini.Router) { r.Get("", index.Get) }) static := martini.Static("templates", martini.StaticOptions{Fallback: "/index.tmpl", Exclude: "/api/v"}) m.NotFound(static, http.NotFound) m.Use(martini.Static("static")) }
func InitRoutes(m *martini.ClassicMartini) { m.Group("/devices", func(r martini.Router) { r.Get("", ListDevices) r.Post("", binding.Form(models.Device{}), CreateDevice) r.Get("/new", NewDevice) // r.Get("/:id", ShowDevice) }) m.Get("/sock", Socket) m.Get("/node", Node) m.NotFound(func(r render.Render) { r.HTML(404, "status/404", "") }) }
func (routeNotFound *RouteNotFound) Routes(m *martini.ClassicMartini) { m.NotFound(func(w http.ResponseWriter, r *http.Request, re render.Render) { re.HTML(200, "error", nil) }) }