-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
35 lines (32 loc) · 1.09 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
var app = require('./express'); // creates an instance of the express lib
var express = app.express;
var cookieParser = require('cookie-parser');
var session = require('express-session');
var passport = require('passport');
var nodemailer = require('nodemailer');
var bodyParser = require('body-parser');
var cors = require('cors');
var sessionSecret = process.env["RUBIXSESSIONSECRET"]
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
// configure a public directory to host static content
app.use(express.static(__dirname + '/public'));
app.use(cookieParser());
app.use(session({secret: sessionSecret}));
app.use(passport.initialize());
app.use(passport.session());
app.use(cors());
require("./app.js");
var logo = `
_____ _ _____ _______ ___
| __ \\| | |_ _|__ __| |__ \\
| |__) | | | | | | ) |
| ___/| | | | | | / /
| | | |____ _| |_ | | / /_
|_| |______|_____| |_| |____|
`
var release = process.argv[2]
var port = release == 'prod' ? 3000 : 8005;
console.log(logo)
console.log("Running on " + port)
app.listen(port);