-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
35 lines (23 loc) · 756 Bytes
/
app.js
File metadata and controls
35 lines (23 loc) · 756 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
32
'use strict';
global.DOCUMENT_ROOT = __dirname;
var NodeBootstrap = require('node-bootstrap-core');
// Load core dependencies
require(DOCUMENT_ROOT + '/app/config/path.js');
var config = require(CONFIG_PATH + '/application.js');
var Application = require(APP_PATH + '/application.js');
// Load bootstrap
var bootstrap = require(APP_PATH + '/bootstrap.js');
var domain = require('domain').create();
domain.on('error', function domainError(error) {
console.error(error);
});
domain.run(function domainRun() {
// Initialize application
var app = new Application();
// Run bootstrap
bootstrap(app);
// Create server instance
var server = new NodeBootstrap(config);
// Start server
server.start(app.requestListener.bind(app));
});