Skip to main content

Crate webserver_base

Crate webserver_base 

Source
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.

featurewhat it is
templatesHandlebars registry, the embedded base layout, template data
analyticsfirst-party proxies for Plausible and the Sentry browser SDK
sitemapsitemap index and url-set generation
feedRSS 2.0, Atom 1.0 and JSON Feed for a site’s content stream
observabilitySentry + tracing, initialised in the one order that works
telegramoutbound Telegram Bot API notifier
webserverthe server builder, state, bootstrap, static-asset pipeline
pagespage declarations that produce routes and sitemap entries
presetTodd Everett Griffin’s personal defaults
fullall 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§

EnvironmentParseError
The value was neither local nor production.

Enums§

Environment
Which deployment this process is.

Constants§

ENV_ENVIRONMENT
The environment variable Environment::from_env reads.