]> git.cworth.org Git - lmno-server/commitdiff
Add serving of static files from ../lmno.games
authorCarl Worth <cworth@cworth.org>
Fri, 6 Mar 2026 11:36:46 +0000 (03:36 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 6 Mar 2026 11:36:46 +0000 (03:36 -0800)
This makes development simpler since we don't need an additional
server to serve the static files, (on our production machine, we do
have a separate web server for the static files).

lmno.js

diff --git a/lmno.js b/lmno.js
index 54baea91f8d5688a74071fa45d19a12cd13ae091..635935556f620ec2361f72642b50a03f5de336a2 100644 (file)
--- a/lmno.js
+++ b/lmno.js
@@ -33,6 +33,9 @@ The "node lmno-passwd.js" command can help generate password hashes.`);
 
 const app = express();
 
+/* Serve static files from the lmno.games directory for local development. */
+app.use(express.static(path.join(__dirname, '..', 'lmno.games')));
+
 /* This 'trust proxy' option, (and, really? a space in an option
  * name?!)  means that express will grab hostname and IP values from
  * the X-Forwarded-* header fields. We need that so that our games