Пример #1
0
func _registerAuthRoutes(server framework.WebServer) {

	var google = framework.GetFactory("controllers.GoogleController").(*auth.GoogleController)
	var facebook = framework.GetFactory("controllers.FacebookController").(*auth.FacebookController)

	server.Get("/", google.HandleRoot)

	server.Get("/load", google.TestHighLoad)

	server.Post("/auth/facebook", facebook.Auth)
	server.Get("/auth/facebook/callback", facebook.AuthCallback)

	server.Post("/auth/google", google.Auth)
	server.Get("/auth/google/callback", google.AuthCallback)
}
Пример #2
0
func _registerRestRoutes(server framework.WebServer) {

	userController := framework.GetFactory("controllers.UserController").(*rest.UserController)

	//user routes
	server.Get("/users", userController.ListUsers)
	server.Get("/user", userController.GetUser)
	server.Post("/user", userController.CreateUser)

	server.Get("/who", userController.Who)

	//event routes
	eventController := framework.GetFactory("controllers.EventController").(*rest.EventController)

	server.Get("/test", eventController.Test)
}