-
-
Save alfrednerstu/972110 to your computer and use it in GitHub Desktop.
Trying out easy-oauth for Node & Connect
This file contains hidden or 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
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}" |
This file contains hidden or 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
$ 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