Recipes
Serve static
Serve a directory of files, such as a front end build.
app.http(adapter) { serveStatic("/assets", "public", index = "index.html", maxAgeSeconds = 3600) }Files under public/ are served below /assets with an ETag and Cache-Control; a directory request returns its index.html. Paths cannot escape the directory. Static files are served before routing, so they do not pass through guards: do not put private files there. For a single-page app put the build output in the directory and serve index.html for client-side routes with a catch-all controller.