forked from sourabhagrawal/mypa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (26 loc) · 733 Bytes
/
app.js
File metadata and controls
29 lines (26 loc) · 733 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 path = require('path');
var logger = require('./utils/log_factory').create("app");
// Initialize App
var app = express();
app.use(express.logger(CONFIG.env));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(path.join(__dirname, 'public')));
app.use(function(err, req, res, next) {
// only handle `next(err)` calls
logger.error(err);
next();
});
// Require dependencies
require('./routes')(app);
//require('./services/scheduler').run();
/**
* Run the server
*/
exports.run = function(port) {
if(port == null || isNaN (port-0) || port =="")
port = CONFIG.port;
app.listen(port);
logger.info("Lewinsky listening on "+port);
}