Skip to content

Instantly share code, notes, and snippets.

@as27
Last active September 27, 2017 13:00
Show Gist options
  • Save as27/d68f127e2f9a7be4f3c3d1fb73a346c5 to your computer and use it in GitHub Desktop.
Save as27/d68f127e2f9a7be4f3c3d1fb73a346c5 to your computer and use it in GitHub Desktop.
Buffalo Auth Tutorial app 01
// 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