forked from DanKottke/midas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (27 loc) · 793 Bytes
/
Copy pathapp.js
File metadata and controls
31 lines (27 loc) · 793 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
30
31
/**
* app.js
*
* To start the server, run: `node app.js`.
*
* `node app.js --silent --port=80 --prod`
*/
// Ensure we're in the project directory, so relative paths work as expected
process.chdir(__dirname);
require('app-module-path').addPath('lib/');
const log = require('log')('app');
log.info('start');
(async function () {
// Ensure all our dependencies can be located:
try {
await require('./app/initialize-on-startup')();
require('./app/openopps')();
} catch (e) {
log.error('Error starting app\n');
log.error(e);
if(e.message.match('Cannot find module')) {
var module = e.message.split('Cannot find module ')[1];
log.error('To fix the error please try running `npm install ' + module.replace(/'/g, '') + '`');
}
return;
}
})();