Skip to main content

webserver_base/webserver/
mod.rs

1//! The web server: builder, shared state, bootstrap, graceful shutdown.
2//!
3//! The application owns `main`. [`bootstrap`] sets up the things that are
4//! process-global and easy to order wrongly — error monitoring, the runtime,
5//! signal handling — and hands back a [`Shutdown`] handle. Everything after
6//! that is ordinary code, so one binary can run several [`WebServer`]s on
7//! different ports and drain them together.
8
9mod bootstrap;
10mod error;
11#[cfg(feature = "pages")]
12mod frontend;
13#[cfg(feature = "pages")]
14mod pages;
15mod server;
16mod shutdown;
17mod state;
18
19pub use bootstrap::bootstrap_with_release;
20pub use error::WebServerError;
21#[cfg(feature = "pages")]
22pub use frontend::{Frontend, FrontendParams, WellKnown};
23pub use server::{API_PREFIX, DEFAULT_BODY_LIMIT, DEFAULT_PORT, ENV_HOST, ENV_PORT, WebServer};
24pub use shutdown::{DEFAULT_DRAIN_TIMEOUT, Shutdown};
25pub use state::WebServerState;
26
27#[cfg(feature = "pages")]
28pub use pages::Pages;