Esempio n. 1
0
func main() {
	// Initialize routes
	r := router.Init(nerdz.Configuration.EnableLog)
	// Enalble CORS globally
	r.Use(echo.WrapMiddleware(cors.New(cors.Options{}).Handler))
	// Recover from panics
	r.Use(middleware.Recover())
	// Start the router
	r.Start(":" + strconv.Itoa(int(nerdz.Configuration.Port)))
}
Esempio n. 2
0
func init() {
	// Initialize every route to test
	e = router.Init(nerdz.Configuration.EnableLog)

	// Create two test app for OAuth 2 request
	//app1 = createOAuth2Client("app 1", "secret 1", "http://localhost/", uint64(1))
	//app2 = createOAuth2Client("app 2", "secret 2", "http://localhost/", uint64(1))
	// Get two test app
	app1, _ = oauth.GetClient("1")
	app2, _ = oauth.GetClient("2")
}