forked from pedromtavares/radio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
28 lines (24 loc) · 922 Bytes
/
app.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
// require('nodetime').profile({
// accountKey: '6fa8b29de58b4f311472c381b9cf04593e1d4082',
// appName: 'Radio'
// });
var express = require('express'),
form = require('connect-form'),
app = module.exports = express.createServer(form({ keepExtensions: true }));
require('./config/environment')(app, express);
require('./config/routes')(app);
app.listen(app.settings.server.port, app.settings.server.host);
setTimeout(function() {
// after reserving priviled port, set process to run on a less privileged user
if (app.settings.server.host){
process.setgid(50);
process.setuid(1000);
console.log("Process now running under user: " + process.getuid());
}
}, 3000);
process.addListener('uncaughtException', function (err, stack) {
console.log('------------------------');
console.log('Exception: ' + err);
console.log(err.stack);
console.log('------------------------');
});