Пример #1
0
// StartAuthServer is used to start the auth server
func StartAuthServer(port string) {

	// Creating a new mux router
	var authrouter = mux.NewRouter().StrictSlash(true)

	// Add Auth routes
	authrouter = routers.AddAuthRoutes(authrouter)

	n := negroni.Classic()

	n.UseHandler(authrouter)
	n.Run(port)
}
Пример #2
0
// StartServer : Start the API Server by calling this function
func StartServer(port string) {

	// Need to activate this for token based access
	var a controllers.Auth

	// Creating a new mux router
	var router = mux.NewRouter().StrictSlash(true)

	// Add APP routes for various controllers
	router = routers.AddVisitorRoutes(router)

	// This route is essential to view the monitoring stats for the app.
	router.Handle("/debug/vars", http.DefaultServeMux)

	n := negroni.Classic()

	// Need to activate this for token based access
	n.Use(negroni.HandlerFunc(a.RequireTokenAuthentication))

	n.UseHandler(router)
	n.Run(port)

}