2015-07-20 09:41:58 +00:00
|
|
|
"use strict";
|
|
|
|
|
2015-08-18 09:56:35 +00:00
|
|
|
var path = require("path");
|
|
|
|
var winston = require("winston");
|
2015-07-20 09:41:58 +00:00
|
|
|
var config = require("./config.js");
|
|
|
|
|
2015-08-10 23:56:53 +00:00
|
|
|
module.exports = app => {
|
2015-08-18 09:56:35 +00:00
|
|
|
app.get("/", (request, response, next) => {
|
2015-07-20 09:41:58 +00:00
|
|
|
response.render("index.hbs");
|
|
|
|
});
|
|
|
|
|
2015-08-18 09:56:35 +00:00
|
|
|
app.get("/redirect", (request, response, next) => {
|
|
|
|
response.render("redirect.hbs", {
|
|
|
|
redirect: config.ensl_url
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-08-10 23:56:53 +00:00
|
|
|
app.get("*", (request, response) => {
|
2015-07-20 09:41:58 +00:00
|
|
|
response.status(404).render("404.hbs");
|
|
|
|
});
|
2015-08-18 09:56:35 +00:00
|
|
|
|
|
|
|
app.use(function (error, request, response, next) {
|
|
|
|
winston.error(error);
|
|
|
|
return response.status(500).render("500.hbs");
|
|
|
|
});
|
2015-07-20 09:41:58 +00:00
|
|
|
};
|