forked from robrighter/easy-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
33 lines (24 loc) · 794 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//setup Dependencies
var connect = require('connect')
, express = require('express')
, util = require('util')
, port = (process.env.PORT || 8081);
//other dependancies
// ejs
var easyoauth = require('./lib/easy-oauth');
//Setup Express
var server = express.createServer();
server.configure(function(){
server.set('views', __dirname + '/views');
server.use(connect.bodyParser());
server.use(express.cookieParser());
server.use(express.session({secret : "shhhhhhhhhhhhhh!"}));
server.use(connect.static(__dirname + '/static'));
server.use(easyoauth(require('./keys_file')));
server.use(server.router);
});
server.listen( port);
server.get('/', function(req,res){
res.render('index.ejs');
});
console.log('Listening on http://0.0.0.0:' + port );