« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/web-routes.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/web-routes.js')
-rw-r--r--src/web-routes.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/web-routes.js b/src/web-routes.js
index b93607d6..a7115bbd 100644
--- a/src/web-routes.js
+++ b/src/web-routes.js
@@ -1,11 +1,13 @@
-import {readdir} from 'node:fs/promises';
+import {readdir, stat} from 'node:fs/promises';
 import * as path from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
 
+/* eslint-disable no-unused-vars */
 const codeSrcPath = __dirname;
 const codeRootPath = path.resolve(codeSrcPath, '..');
+/* eslint-enable no-unused-vars */
 
 function getNodeDependencyRootPath(dependencyName) {
   return (
@@ -106,6 +108,21 @@ export async function identifyDynamicWebRoutes({
     ]),
 
     () => {
+      const from =
+        path.resolve(path.join(mediaPath, 'favicon.ico'));
+
+      return stat(from).then(
+        // {statically: 'copy'} is not workable for individual files
+        // at the moment, so this remains a symlink.
+        () => [{
+          from,
+          to: ['shared.path', 'favicon.ico'],
+          statically: 'symlink',
+        }],
+        () => []);
+    },
+
+    () => {
       if (!wikiCachePath) return [];
 
       const from =