Skip to main content

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// Every fallible function in this crate returns `postrust_core::Error`, which
11// is a wide enum by design: a PostgREST error carries its code, message,
12// details and hint. Boxing it to satisfy the lint would put an allocation on
13// the error path of every request to save a return slot on the success path.
14// `postrust-core` takes the same position at its own crate root; this was
15// being restated a dozen times a file instead.
16#![allow(clippy::result_large_err)]
17
18pub mod app;
19pub mod lenient_uri;
20pub mod state;
21
22#[cfg(feature = "admin-ui")]
23pub mod admin;
24
25pub use app::handle_request;
26pub use state::AppState;
27
28#[cfg(feature = "admin-ui")]
29pub use admin::admin_router;