Permalink
Browse files

Outsources routes

  • Loading branch information...
1 parent 7fd8d21 commit 414585fc07f82c8e0c55d62ed755b8483e99d70d @kynan kynan committed Oct 13, 2012
Showing with 17 additions and 14 deletions.
  1. +1 −14 app.coffee
  2. +16 −0 routes.coffee
View
@@ -44,17 +44,4 @@ require('zappajs') host, port, ->
mongoose.connect "mongodb://#{mongo.username}:#{mongo.password}@#{mongo.hostname}:#{mongo.port}/#{mongo.db}"
@use 'errorHandler'
- @get '/': ->
- @render 'landing': {passport: @session.passport}
-
- @get '/env': -> @response.json process.env
-
- # Authenication
- @app.get '/auth/google', passport.authenticate 'google'
- @app.get '/auth/google/return', passport.authenticate 'google', { successRedirect: '/', failureRedirect: '/login' }
-
- @get '/auth/:provider': ->
- passport.authenticate @params.provider
-
- @get '/auth/:provider/return': ->
- passport.authenticate @params.provider, { successRedirect: '/', failureRedirect: '/login' }
+ @include 'routes'
View
@@ -0,0 +1,16 @@
+passport = require 'passport'
+@include = ->
+ @get '/': ->
+ @render 'landing': {passport: @session.passport}
+
+ @get '/env': -> @response.json process.env
+
+ # Authenication
+ @app.get '/auth/google', passport.authenticate 'google'
+ @app.get '/auth/google/return', passport.authenticate 'google', { successRedirect: '/', failureRedirect: '/login' }
+
+ @get '/auth/:provider': ->
+ passport.authenticate @params.provider
+
+ @get '/auth/:provider/return': ->
+ passport.authenticate @params.provider, { successRedirect: '/', failureRedirect: '/login' }

0 comments on commit 414585f

Please sign in to comment.