Created
March 11, 2012 20:42
-
-
Save bnoguchi/2018148 to your computer and use it in GitHub Desktop.
EveryAuth issue #208 (CoffeeScript)
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
bootstrapAuthentication() | |
application = express.createServer() | |
application.configure -> | |
bootstrap(application) | |
application.listen(2536) | |
bootstrapAuthentication = () -> | |
everyauth.twitter | |
.consumerKey(myConsumerKey) | |
.consumerSecret(myConsumerSecret) | |
.findOrCreateUser( | |
(session, accessToken, accessTokenSecret, twitterUser) -> | |
console.log twitterUserData | |
console.log accessToken | |
console.log accessTokenSecret | |
return twitterUser | |
) | |
.redirectPath('/') | |
bootstrap = (application) -> | |
bootstrapExpress(application) | |
bootstrapRoutes(application) | |
bootstrapCouchDB() | |
bootstrapExpress = (application) -> | |
application.use(express.bodyParser()) | |
application.use(express.methodOverride()) | |
application.use(express.cookieParser()) | |
application.use(express.session( secret: '54df54df151df' )) | |
application.use(everyauth.middleware()) | |
application.use(application.router) | |
application.use(express.static(__dirname + '/public')) | |
application.use(express.errorHandler()) | |
everyauth.helpExpress(application) | |
application.helpers(viewHelpers) | |
application.set('view engine', 'jade') | |
application.set('showStackTrace', application.settings.env == 'development') | |
bootstrapRoutes = (application) -> | |
application.get('/', routes.index) | |
bootstrapCouchDB = -> | |
# Bootstrapping cradle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment