From c2732983d029051893fa9b45b118362e05c16137 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 18 Feb 2019 21:27:43 +0100 Subject: [PATCH] Fix absolute paths in html --- src/utils/api.js | 3 ++- src/utils/serverRender.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index a33fc31..1fe02de 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,12 +1,13 @@ import fs from 'fs' import jsonfile from 'jsonfile' +import path from 'path' import config from '../../config.json' export function getData (reqPath = '') { if (reqPath === '') { return readData(config.dataPath) } else { - const fileName = '../../renders/' + reqPath + '.html' + const fileName = path.join(process.cwd(), 'renders/', reqPath + '.html') return readFile(fileName) } }; diff --git a/src/utils/serverRender.js b/src/utils/serverRender.js index 06bf2a9..dd57588 100644 --- a/src/utils/serverRender.js +++ b/src/utils/serverRender.js @@ -34,13 +34,13 @@ function renderFullPage (html, data) { - +
${html}
- + `