-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (30 loc) · 800 Bytes
/
index.js
File metadata and controls
34 lines (30 loc) · 800 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
33
34
const path = require("path");
const nconf = require("nconf");
const server = require("./server");
// Handle uncaught.
process.on("uncaughtException", err => {
console.error(err);
});
// Initialize configuration.
nconf
.argv()
.env()
.file(path.join(__dirname, "./server/config.json"))
.defaults({
NODE_ENV: "development",
HOSTING_ENV: "default",
AUTH0_RTA: "https://auth0.auth0.com",
PORT: 3001,
WT_URL: "http://localhost:3001",
PUBLIC_WT_URL: "http://localhost:3001"
});
// Start the server.
const app = server(key => nconf.get(key), null);
const port = nconf.get("PORT");
app.listen(port, error => {
if (error) {
console.error(`Got error during startup: ${error.message}`);
} else {
console.log(`Listening on http://localhost:${port}.`);
}
});