Exemple #1
0
func init() {

	v1NS := beegae.NewNamespace("/v1",
		beegae.NSNamespace("/object",
			beegae.NSRouter("/", &controllers.ObjectController{}, "get:GetAll;post:Post;put:Put"),
			beegae.NSRouter("/:objectId", &controllers.ObjectController{}, "get:Get;delete:Delete")))
	beegae.AddNamespace(v1NS)
	/*
	   beegae.Router("/v1/object",&controllers.ObjectController{},"get:GetAll")
	   beegae.Router("/v1/object",&controllers.ObjectController{},"post:Post")
	   beegae.Router("/v1/object/:objectId",&controllers.ObjectController{},"get:Get")
	   beegae.Router("/v1/object",&controllers.ObjectController{},"put:Put")
	   beegae.Router("/v1/object/:objectId",&controllers.ObjectController{},"delete:Delete")
	*/
	beegae.Router("/_session_gc", &controllers.GCController{})
	beegae.Router("/", &controllers.MainController{})
}
Exemple #2
0
func init() {
	http.Handle("/static/css/", http.StripPrefix("/static/css/", http.FileServer(http.Dir("../static/css"))))
	http.Handle("/static/js/", http.StripPrefix("/static/js/", http.FileServer(http.Dir("../static/js"))))
	http.Handle("/static/components/js/", http.StripPrefix("/static/components/js/", http.FileServer(http.Dir("../static/components/js"))))

	beegae.Router("/", &controllers.MainController{})
	beegae.Run()

	// api := rest.NewApi()
	// api.Use(rest.DefaultDevStack...)
	// router, err := rest.MakeRouter(
	// 	rest.Post("/api/v1/", PostDataHandler),
	// )

	// if err != nil {
	// 	log.Fatal(err)
	// }

	// api.SetApp(router)
	// http.Handle("/", api.MakeHandler())
	// http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))

}
Exemple #3
0
func init() {
	beegae.Router("/todos", &controllers.MainController{})
	beegae.Run()
}
Exemple #4
0
func init() {
	beegae.Router("/", &controllers.MainController{})
}