Last active
September 27, 2017 13:00
-
-
Save as27/d68f127e2f9a7be4f3c3d1fb73a346c5 to your computer and use it in GitHub Desktop.
Buffalo Auth Tutorial app 01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App is where all routes and middleware for buffalo | |
// should be defined. This is the nerve center of your | |
// application. | |
func App() *buffalo.App { | |
if app == nil { | |
app = buffalo.Automatic(buffalo.Options{ | |
Env: ENV, | |
SessionName: "_githubauth_session", | |
Host: "http://localhost:3000", | |
}) | |
app.GET("/", HomeHandler) | |
app.ServeFiles("/assets", assetsPath()) | |
auth := app.Group("/auth") | |
auth.GET("/{provider}", buffalo.WrapHandlerFunc(gothic.BeginAuthHandler)) | |
auth.GET("/{provider}/callback", AuthCallback) | |
} | |
return app | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment