@marmeon/server
v0.3.0
Published
The HTTP server of Marmeon apps: the kernel on Hono, server rendering through Vite or the build, islands, health checks and graceful shutdown.
Readme
@marmeon/server
The HTTP server of Marmeon apps: the kernel, server rendering through Vite or the build, the health endpoints and a graceful stop without dropped requests.
Installation
Part of every new Marmeon app: pnpm create marmeon installs it.
Vite is a peer, never a dependency: the server runs the app's own Vite in development, and marmeon build needs it. A new app
has vite and @marmeon/vite as dev dependencies; marmeon start serves the build without them.
Building and starting
pnpm marmeon build # injection lists, route types, type check, the browser's files and the server rendering
pnpm marmeon start # serves the build: NODE_ENV=production unless the environment says otherwise (a .env's development or test is refused)
NODE_ENV=production APP_ENV=staging pnpm marmeon start # a staging server: production, named stagingNODE_ENV is development, test or production; any other value stops the start. APP_ENV names the environment and picks
the scheduled tasks of .environments(); it never weakens a protection or turns on a development tool.
GET /up answers once the app booted, GET /up/ready runs every health check of the app and its packages. On SIGTERM the
server leaves readiness, finishes the requests in flight and exits.
Documentation
- Request Lifecycle
- Deployment
- Deployment: staging
- Deployment: stopping without dropped requests
- Health Checks
- Error Handling: the development error page
MIT · part of Marmeon
