diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-01 19:33:24 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:44 -0300 |
commit | b7183b9b1553f2c051644af92b4dc19eea705826 (patch) | |
tree | 1f90198dc47615394fb442a3f3c5c6d6a75604cc /src/web-routes.js | |
parent | 3b2f391d291e37e0c39a3fc4c7a406c4b6da12b1 (diff) |
web-routes: make search corpuses available at /search-data
Diffstat (limited to 'src/web-routes.js')
-rw-r--r-- | src/web-routes.js | 12 |
1 files changed, 12 insertions, 0 deletions
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 = |