Skip to main content

Crate parse_rust_server

Crate parse_rust_server 

Source
Expand description

Parse Server as a library: router, middleware, config.

A library first, with a thin binary on top. Native Rust triggers require the deployment to compile its own binary, and adapters are registered through a builder rather than resolved from a module name, so the primary artifact is something you link against. parse-rust-cli is a separate package rather than a feature of this one: feature unification means a sibling crate enabling a cli feature would pull its dependencies back in even for an embedder that set default-features = false, and a separate package cannot be re-enabled by anyone else’s feature choice.

Scope today: /health, /serverInfo, the five /classes verbs, and signup, login, /users/me and logout. GET /serverInfo was built first because it is the smallest thing that forces the whole request path into existence: mount path, header parsing, client-key validation, the master-key gate, and both error envelopes.

An embedder that builds the router itself must call AppState::ensure_indexes first. serve does it for you. Mounting router into your own axum app does not, and without those indexes duplicate usernames are accepted silently, which is a data problem rather than an error anyone sees.

Re-exports§

pub use auth::Authority;
pub use auth::HeaderRejection;
pub use config::ServerConfig;
pub use state::AppState;

Modules§

auth
Request identity, derived from headers.
body_credentials
Normalizing what the JavaScript SDK actually sends.
config
Server configuration.
response
Error response envelopes.
routes
HTTP routes. One module per upstream router, so a change upstream maps to an obvious place.
sessions
Session tokens.
state
Server state: config plus the storage adapter.

Functions§

router
Build the router.
serve
Bind and serve. Returns the bound address, which matters when the caller asked for port 0.