This documentation is deprecated. It covers rspc 0.3.0, which is no longer maintained.
Quickstart
Run the released rspc 0.3.0 API with Axum.
This guide is for an existing application using rspc 0.3.0. rspc is no longer maintained. Do not mix these dependencies with the experimental procedure API.
Create a project
If you add Specta directly for custom payload derives, use the 2.0.0-rc.20 release required by rspc 0.3.0, not the version in the current Specta guide.
Define and expose a router
Run cargo run to export bindings.ts and start the server. Binding export through Config happens only in debug builds. Run the router test in CI before building the frontend.
Create a frontend client
Copy or export the bindings into your frontend source directory:
Proxy the same-origin /rspc path to the Rust server during development. For a cross-origin API, use its full URL and configure CORS in Axum.
Next steps
- Router: add procedures, merge routers, and export bindings.
- Middleware: authenticate requests and change context.
- Vanilla client: configure transports and credentials.
- Deployment: generate bindings and deploy the server.
