From e73d93031c8dd464295f56cdd54582c4fb2c0036 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 12 Jul 2016 12:44:44 +0200 Subject: [PATCH] use an absolutely specific regex for the document root --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 491ffa89f..b67b6d28a 100644 --- a/server.js +++ b/server.js @@ -41,9 +41,9 @@ var handleFile = function (target, res, fallback, next) { stream.pipe(res); }; -app.use("/customize/", Express.static(__dirname + '/customize', staticOpts)); +app.use("/customize", Express.static(__dirname + '/customize')); app.use("/customize", Express.static(__dirname + '/customize.dist')); -app.use("/", function(req, res, next) { +app.use(/^\/$/, function(req, res, next) { handleFile(__dirname + '/customize/index.html', // try piping this file first res, __dirname + '/customize.dist/index.html', // if it doesn't exist next); // finally, fall through