-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (24 loc) · 942 Bytes
/
app.js
File metadata and controls
29 lines (24 loc) · 942 Bytes
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
var express = require('express');
var cookieParser = require('cookie-parser');
var routes = require('./routes/routes.js');
var mongoose = require('mongoose');
var proto = require('./prototypes.js')
var app = express();
app.use(express.static(__dirname + '/public'));
app.use(cookieParser('=(*hj1!yat*vz=w6vlu1te9e&k4cp_3(w1$*!tf5ei$58&(sk5'));
// connect to Mongo when the app initializes
mongoose.connect('mongodb://localhost/testDB');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback () {
console.log('\n---DB Connected---');
});
app.get('/home', routes.home);
//app.get('/query', routes.query);
app.get('/stats.json', routes.stats);
app.get('/login', routes.login);
app.get('/oauth2callback', routes.oauth2callback);
app.get('/getEmails', routes.getEmails);
app.get('/removeEmails', routes.removeEmails)
app.listen(5001);
console.log('* Started *');