Expand description
Shared logic for Todd Everett Griffin’s web servers, as a set of independently feature-gated kits.
Every kit works on its own — a bot that wants only Telegram notifications
enables telegram and compiles neither axum nor Handlebars. Together they
compose into one opinionated web server. Nothing is enabled by default.
| feature | what it is |
|---|---|
templates | Handlebars registry, the embedded base layout, template data |
analytics | first-party proxies for Plausible and the Sentry browser SDK |
sitemap | sitemap index and url-set generation |
feed | RSS 2.0, Atom 1.0 and JSON Feed for a site’s content stream |
observability | Sentry + tracing, initialised in the one order that works |
telegram | outbound Telegram Bot API notifier |
webserver | the server builder, state, bootstrap, static-asset pipeline |
pages | page declarations that produce routes and sitemap entries |
preset | Todd Everett Griffin’s personal defaults |
full | all of the above |
§Configuration
Every kit is constructed manually first; from_env is a convenience layered
on top. All environment variables this crate reads are prefixed WSB_ so
they cannot collide with a project’s own.
Re-exports§
pub use webserver::AppShutdown;pub use webserver::Shutdown;pub use webserver::WebServer;pub use webserver::WebServerError;pub use webserver::WebServerState;pub use webserver::bootstrap_with_release;
Modules§
- analytics
- First-party proxies for Plausible and the Sentry browser SDK.
- assets
- Content-hashed static assets.
- env
- Reading configuration out of the environment.
- feed
- RSS 2.0, Atom 1.0 and JSON Feed 1.1 for a site’s one content stream.
- observability
- Sentry and tracing, initialised in the one order that works.
- sitemap
- Sitemap generation: always an index, always at least one url set.
- telegram
- An outbound Telegram Bot API notifier.
- templates
- Handlebars rendering, and the three types that feed it.
- webserver
- The web server: builder, shared state, bootstrap, graceful shutdown.
Macros§
- bootstrap
- Starts a server, naming the running build from the calling crate.
Structs§
- Environment
Parse Error - The value was neither
localnorproduction.
Enums§
- Environment
- Which deployment this process is.
Constants§
- ENV_
ENVIRONMENT - The environment variable
Environment::from_envreads.