-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathserver.js
More file actions
42 lines (31 loc) · 1.08 KB
/
Copy pathserver.js
File metadata and controls
42 lines (31 loc) · 1.08 KB
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
33
34
35
36
37
38
39
40
41
42
function loadLib () {
const POLYFILLS = require("./components/Polyfills/0/server.api");
const LIBRARY = require("./components/Library/0/server.api").forPoly(POLYFILLS);
var lib = {};
LIBRARY._.assign(lib, POLYFILLS);
LIBRARY._.assign(lib, LIBRARY);
return lib;
}
const LIB = loadLib();
LIB.Promise.try(function () {
// Boot configuration
const BOOT_CONFIG_PATH = LIB.path.join(__dirname, "PINF.Genesis.ccjson");
// Boot implementation
function makeContext (type, config) {
if (type === "config") {
return require("./cores/config/0-server.api").forLib(LIB).then(function (exports) {
return new exports.Context(config);
});
}
throw new Error("Unknown context type '" + type + "'");
}
return makeContext("config", {
env: process.env,
path: BOOT_CONFIG_PATH
}).then(function (configContext) {
return configContext.adapters["pinf.genesis.config"].spin(configContext);
});
}).catch(function (err) {
console.error(err.stack);
process.exit(1);
})