forked from ideal-postcodes/postcodes.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (20 loc) · 726 Bytes
/
server.js
File metadata and controls
26 lines (20 loc) · 726 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
"use strict";
var path = require("path");
var env = process.env.NODE_ENV || "development";
var config = require(path.join(__dirname, "config/config"))(env);
if (env === "test" || process.env.PMX) {
require('pmx').init({
http : true
});
}
var express = require("express");
var app = express();
require(path.join(__dirname, "/config/logger"))(app, config);
require(path.join(__dirname, "/config/db"))(config);
require(path.join(__dirname, "/config/express"))(app, config);
require(path.join(__dirname, "/config/routes"))(app);
require(path.join(__dirname, "/config/renderer"))(app);
var port = config.port || 8000;
app.listen(port);
console.log("Postcode API listening on port", port);
exports = module.exports = app;