forked from BucknellLaunch/OSCTC-Practice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (21 loc) · 639 Bytes
/
app.js
File metadata and controls
26 lines (21 loc) · 639 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
var express = require('express');
var path = require('path');
var _ = require('underscore');
var routes = require('./src/routes');
var app = express();
// set application params
app.set('title', 'Open Source Comes to Campus');
// set application paths
app.use(express.static(path.join(__dirname, 'public')));
// set routes
app.use('/', routes);
// listen on either user specified port or 3000
if (process.argv.length > 2) {
console.log("Process started on port " + process.argv[2]);
app.listen(process.argv[2]);
} else {
console.log("Process started on port 3000");
app.listen(3000);
}
// export the app
module.exports = app;