code.nochebuena.dev/einherjar/spa-server

Package spaserver provides a lifecycle-managed HTTP server for serving single-page applications (SPA) and progressive web apps (PWA) from a container. The server delivers static assets from a configurable directory and falls back to index.html for any request path that does not map to an existing file — the standard SPA routing contract. A health endpoint is included at /health with the same JSON wire format used across all Einherjar modules. NewServer returns a [lifecycle.Component] that integrates directly with [launcher.New]. Server.OnInit builds the HTTP mux. Server.OnStart begins serving in a goroutine. Server.OnStop performs a graceful shutdown. All fields are read from environment variables: The module ships as a ready-to-use base image. A downstream SPA Dockerfile only needs to copy the built assets:


License
AGPL-3.0
Install
go get code.nochebuena.dev/einherjar/spa-server