From 71346f341f53d5b7b9586f58227e7d6634d453b3 Mon Sep 17 00:00:00 2001 From: michael <1+michael@noreply.git.casaderoll.de> Date: Thu, 24 Sep 2026 09:57:52 +0200 Subject: [PATCH] Add Express static server --- server.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 server.js diff --git a/server.js b/server.js new file mode 100644 index 0000000..1ecfa56 --- /dev/null +++ b/server.js @@ -0,0 +1,36 @@ +// Digital Spaceport Arcade — static server +// Pure JS. Serves ./public on 0.0.0.0:8099 +const express = require('express'); +const path = require('path'); + +const app = express(); +const PORT = process.env.PORT || 8099; +const HOST = process.env.HOST || '0.0.0.0'; + +app.use(express.static(path.join(__dirname, 'public'), { + extensions: ['html'], + setHeaders(res, filePath) { + if (filePath.endsWith('.html')) { + res.setHeader('Cache-Control', 'no-cache'); + } + } +})); + +// Favicon: inline SVG (retro pixel heart) +app.get('/favicon.ico', (req, res) => { + res.type('image/svg+xml').send( + '' + + '' + + '' + + '' + + '' + + '' + + '' + ); +}); + +app.get('/healthz', (req, res) => res.json({ ok: true, name: 'digital-spaceport-arcade' })); + +app.listen(PORT, HOST, () => { + console.log(`[dsp-arcade] serving on http://${HOST}:${PORT}`); +});