-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
29 lines (24 loc) · 990 Bytes
/
index.js
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
/* global require, process, __dirname, console */
require("newrelic");
var Express = require("express"),
newrelic = require("newrelic"),
compression = require("compression"),
serveStatic = require('serve-static'),
jade = require("jade"),
port = Number(process.env.PORT || 5000),
staticAssetsUrl = process.env.STATIC_ASSETS_URL || ".",
directory = process.env.NODE_ENV === "production" ? "/build" : "/public",
server = new Express();
server.locals.newrelic = newrelic;
server.use(compression());
// This is required to serve legacy copied email signatures
server.use(serveStatic(__dirname + "/public"));
server.set("views", __dirname + directory + "/jade");
server.engine("jade", jade.__express);
server.get("/", function (request, response) {
"use strict";
response.set("Cache-Control", "no-cache");
response.render("index.jade", {staticAssetsUrl: staticAssetsUrl});
});
server.listen(port);
console.log("Server listening on port " + port);