From c99f540fb931127602c2ca97a15f761bee43167d Mon Sep 17 00:00:00 2001 From: Walamana Date: Tue, 28 Nov 2017 20:50:47 +0100 Subject: [PATCH] update Signed-off-by: Walamana --- app.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index e2fde40..e97b391 100644 --- a/app.js +++ b/app.js @@ -3,6 +3,12 @@ var cookieParser = require("cookie-parser"); var app = express(); app.use(cookieParser()); +app.use((req, res, next) => { + res.setHeader("Access-Control-Allow-Origin", "*"); + return next(); +}); +app.use(express.static(path.join(application_root, "StaticPages"))); +app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); var uuid = require("uuid/v4"); var mysql = require("mysql"); @@ -136,15 +142,6 @@ var attachToMini = function(mini){ } -app.configure(function(){ - app.use((req, res, next) => { - res.setHeader("Access-Control-Allow-Origin", "*"); - return next(); - }); - app.use(express.static(path.join(application_root, "StaticPages"))); - app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); -}); - app.listen(process.env.PORT);