1
0
mirror of https://github.com/trambarhq/relaks-wordpress-example.git synced 2025-09-02 12:42:38 +02:00

Reworked code to allow use of basePath other than / (issue #20).

Throwing error properly in JSON retrieval code (issue #44).
This commit is contained in:
Chung Leong
2019-01-30 21:57:52 +01:00
parent 7e02514752
commit c5fd724e2f
12 changed files with 187 additions and 105 deletions

View File

@@ -9,8 +9,8 @@ const CACHE_SIZE = 500;
const HTML_TEMPLATE = `${__dirname}/client/index.html`;
async function generate(path, target) {
// retrieve cached JSON through Nginx
console.log(`Regenerating page: ${path}`);
// retrieve cached JSON through Nginx
let host = NGINX_HOST;
// create a fetch() that remembers the URLs used
let sourceURLs = [];
@@ -42,4 +42,5 @@ async function prefetch(path) {
module.exports = {
generate,
prefetch,
basePath: FrontEnd.basePath
};