Skip to content

Instantly share code, notes, and snippets.

@alfrednerstu
Created May 14, 2011 10:55
Show Gist options
  • Save alfrednerstu/972110 to your computer and use it in GitHub Desktop.
Save alfrednerstu/972110 to your computer and use it in GitHub Desktop.
Trying out easy-oauth for Node & Connect
connect = require 'connect'
express = require 'express'
easyoauth = require 'easy-oauth'
jade = require 'jade'
app = express.createServer()
# CONFIGURATION
app.configure(() ->
app.set 'view engine', 'jade'
app.set 'views', "#{__dirname}/views"
app.use connect.bodyParser()
app.use express.cookieParser()
app.use express.session({secret : "shhhhhhhhhhhhhh!"})
app.use connect.static(__dirname + '/static')
app.use express.logger()
app.use express.methodOverride()
app.use easyoauth(require('./keys_file'))
app.use app.router
)
app.configure 'development', () ->
app.use express.errorHandler({
dumpExceptions: true
showStack : true
})
app.configure 'production', () ->
app.use express.errorHandler()
# ROUTES
app.get '/', (req, res) ->
res.render 'index',
locals:
title: 'Test'
# SERVER
app.listen(1234)
console.log "Express server listening on port #{app.address().port}"
$ coffee -w app.coffee
undefined
// When I try to start the server I just get undefined. When I comment away app.use easyoauth(require('./keys_file')) the site works, but still not /auth/client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment