-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
42 lines (36 loc) · 1.15 KB
/
server.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
34
35
36
37
38
39
40
41
42
// use express for routing
var express = require('express')
, http = require ('http')
, app = express()
, server = http.createServer(app);
// , passport = require('passport')
// connect to mongoDB
var databaseUrl = "inqueue";
var collections = ["q"];
app.db = require('mongojs').connect(databaseUrl, collections);
// hack to figure out routing for now...
//app.api = "ec2-54-244-184-198.us-west-2.compute.amazonaws.com/api";
// set up static routes
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
/*
//setting up passport.js
app.configure(function() {
app.use(express.static(__dirname + '/public'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.session({ secret: 'uhpnext' }));
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
});
*/
// set up routes in the routes/ folder
// all the js files in routes
require('./routes')(app);
//require('./routes/passport')(passport, config);
// start server
// aws -> 80 default http connection
// sudo nohup node server.js ------> log in as admin to run for AWS
server.listen(80);
console.log('Listening on port 80');