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}
- + `