Esempio n. 1
0
func RegisterRoutes(router *mux.Router, ctx *routes.Context) {
	adminRouter := router.PathPrefix("/admin").Subrouter()

	adminRouter.HandleFunc("/edit/{id}", routes.Wrap(getEdit, ctx)).
		Methods("GET")

	adminRouter.HandleFunc("/edit", routes.Wrap(postEdit, ctx)).
		Methods("POST")

	adminRouter.HandleFunc("/render", routes.Wrap(postRender, ctx)).
		Methods("POST")

	adminRouter.HandleFunc("/gallery_reset/{gallery}", routes.Wrap(getGalleryReset, ctx)).
		Methods("GET")
}
Esempio n. 2
0
func RegisterRoutes(router *mux.Router, ctx *routes.Context) {
	router.HandleFunc("/", routes.Wrap(getIndex, ctx))
	router.HandleFunc("/post/{id:[0-9]+}/{slug}", routes.Wrap(getPost, ctx))
	router.HandleFunc("/post/{id:[0-9]+}", routes.Wrap(getPost, ctx))
	router.HandleFunc("/blog/{page:[0-9]+}", routes.Wrap(getGenericArchive, ctx))
	router.HandleFunc("/blog/{category:[a-z_]+}/{page:[0-9]+}", routes.Wrap(getCategoryArchive, ctx))

	//Non-blog related, but informational pages
	router.HandleFunc("/projects", routes.Wrap(getProjects, ctx))
	router.HandleFunc("/about", routes.Wrap(getAbout, ctx))
}
Esempio n. 3
0
func RegisterRoutes(router *mux.Router, ctx *routes.Context) {
	debugRouter := router.PathPrefix("/debug").Subrouter()

	debugRouter.HandleFunc("/hello", routes.Wrap(getHello, ctx)).
		Methods("GET")
}