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(all(test, feature = "pages"))]
14mod into_router_tests;
15#[cfg(feature = "pages")]
16mod pages;
17mod server;
18mod shutdown;
19mod state;
20
21pub use bootstrap::bootstrap_with_release;
22pub use error::WebServerError;
23#[cfg(feature = "pages")]
24pub use frontend::{Frontend, FrontendParams, WellKnown};
25pub use server::{API_PREFIX, DEFAULT_BODY_LIMIT, DEFAULT_PORT, ENV_HOST, ENV_PORT, WebServer};
26pub use shutdown::{AppShutdown, DEFAULT_DRAIN_TIMEOUT, Shutdown};
27pub use state::WebServerState;
28
29#[cfg(feature = "pages")]
30pub use pages::Pages;