diff options
author | Noah Loomans <noahloomans@gmail.com> | 2017-03-22 12:55:15 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2017-03-22 12:55:15 +0100 |
commit | aacb48afce4ee021535f938b2b418a2e0796d105 (patch) | |
tree | 14cd8733bb1070655645f88af310643c4459f9e4 | |
parent | 0f77408d646590273bcadb17e12256e93fee9600 (diff) |
Fix sending wrong file when not in correct directory
-rw-r--r-- | routes/manifest.js | 5 |
1 files 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') }) } }) |