From 0d825b4458f6b1f8d2c765bd3fb60990ef540eec Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Tue, 21 Jul 2026 05:27:27 +0200 Subject: [PATCH] Split server.mjs into modules: db, views, routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server.mjs mixed SQL schema, HTML-rendering functions, and route handling in one 476-line file. Split by concern: - src/db.mjs — schema + migrations (openDb()) - src/views.mjs — pure render functions: layout, incidentForm, publicMarkdown/Incident/Detail, no db or network access - src/style.mjs — the stylesheet, now genuinely shared instead of duplicated (receipts.mjs's /events page had its own near-copy, which is exactly what let their