From 08783d4d7bebb5c28914f1f6713fab1b71a00a92 Mon Sep 17 00:00:00 2001 From: Max Milne <117334700+maxmilneaus@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:24:23 +1100 Subject: [PATCH] fix: serve dist/assets when self-hosting the editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit share-web-routes.ts reads dist/index.html and injects it as the SPA shell for /d/:slug routes, but server/index.ts only mounts a static file server for public/ — not dist/. This means the browser loads the editor HTML but immediately 404s on /assets/editor.js (and all other built assets), resulting in a blank white page with no editor UI when self-hosting. Fix: add express.static for the dist directory alongside the existing public directory static server. Reproduction: 1. Clone the repo and run: npm install && npm run build && npm run serve 2. Create a doc: POST /documents with a markdown body 3. Open the returned URL in a browser 4. Page is blank; browser console shows 404s for /assets/editor.js --- server/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/index.ts b/server/index.ts index 268cc05..1d4d042 100644 --- a/server/index.ts +++ b/server/index.ts @@ -44,6 +44,7 @@ async function main(): Promise { app.use(express.json({ limit: '10mb' })); app.use(express.static(path.join(__dirname, '..', 'public'))); + app.use(express.static(path.join(__dirname, '..', 'dist'))); app.use((req, res, next) => { const originHeader = req.header('origin');