postrust_server/lib.rs
1//! Postrust Server library.
2//!
3//! This crate provides the HTTP server implementation for Postrust.
4//!
5//! ## Features
6//!
7//! - `admin-ui` - Enables the admin UI with OpenAPI documentation,
8//! Swagger UI, Scalar, and GraphQL Playground at `/admin`.
9
10#![warn(missing_docs)]
11// Every fallible function in this crate returns `postrust_core::Error`, which
12// is a wide enum by design: a PostgREST error carries its code, message,
13// details and hint. Boxing it to satisfy the lint would put an allocation on
14// the error path of every request to save a return slot on the success path.
15// `postrust-core` takes the same position at its own crate root; this was
16// being restated a dozen times a file instead.
17#![allow(clippy::result_large_err)]
18
19pub mod app;
20pub mod lenient_uri;
21pub mod state;
22
23#[cfg(feature = "admin-ui")]
24pub mod admin;
25
26pub use app::handle_request;
27pub use state::AppState;
28
29#[cfg(feature = "admin-ui")]
30pub use admin::admin_router;