diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/url-spec.js | 5 | ||||
-rw-r--r-- | src/web-routes.js | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/url-spec.js b/src/url-spec.js index b1d201a4..39f79459 100644 --- a/src/url-spec.js +++ b/src/url-spec.js @@ -118,6 +118,11 @@ const urlSpec = { prefix: 'thumb/', paths: genericPaths, }, + + searchData: { + prefix: 'search-data/', + paths: genericPaths, + }, }; // This gets automatically switched in place when working from a baseDirectory, diff --git a/src/web-routes.js b/src/web-routes.js index 619d5c62..6b1335ac 100644 --- a/src/web-routes.js +++ b/src/web-routes.js @@ -53,6 +53,18 @@ export async function identifyDynamicWebRoutes({ {from: path.resolve(mediaPath), to: ['media.root']}, {from: path.resolve(mediaCachePath), to: ['thumb.root']}, ]), + + () => { + if (!wikiCachePath) return []; + + const from = + path.resolve(path.join(wikiCachePath, 'search')); + + return ( + readdir(from).then( + () => [{from, to: ['searchData.root']}], + () => [])); + }, ]; const routeCheckPromises = |