From aacb48afce4ee021535f938b2b418a2e0796d105 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 22 Mar 2017 12:55:15 +0100 Subject: Fix sending wrong file when not in correct directory --- routes/manifest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/manifest.js b/routes/manifest.js index 377b7be..b2ce55f 100644 --- a/routes/manifest.js +++ b/routes/manifest.js @@ -2,6 +2,7 @@ const express = require('express') const router = express.Router() +const path = require('path') router.get('/', function (req, res, next) { console.log('got a request') @@ -9,9 +10,9 @@ router.get('/', function (req, res, next) { const isBeta = process.env.BETA === '1' if (isBeta) { - res.sendFile('manifest.beta.webmanifest', { root: './public' }) + res.sendFile('manifest.beta.webmanifest', { root: path.join(__dirname, '../public') }) } else { - res.sendFile('manifest.webmanifest', { root: './public' }) + res.sendFile('manifest.webmanifest', { root: path.join(__dirname, '../public') }) } }) -- cgit v1.1