-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
23 lines (23 loc) · 828 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// IMPORTS
// ============================================================================
const validate = require('./services/validate');
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;
const pjson = require('./package.json');
const debug = require('debug')('app');
// CONFIG
// ============================================================================
require('./config/index')(app);
require('./routes/index')(app);
require('./error-handling/index')(app);
// SERVER INIT
// ============================================================================
app.listen(port, error => {
if (error) {
debug(error);
return;
}
debug("it failed")
console.log(`${pjson.name} v${pjson.version} is running on http://${process.env.SITE_HOST}:${port}`);
});