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