Roadster vs. Axum

Roadster actually uses Axum to provide an HTTP server, so anything you can do with plain Axum you can do with Roadster. However, using Roadster has some benefits compared to configuring Axum yourself:

  • Roadster registers a collection of common middleware with sensible default configurations. The configurations can also be customized easily via config files. See Axum middleware for more information.
  • Roadster creates an AppContext to use as the Axum State that contains all the dependency objects created by Roadster, such as the DB connection, app config, etc. This can also be extended using Axum's FromRef if you need to provide additional state to your Axum routes. See Axum state for more information.
  • Roadster supports registering API routes using Aide to enable auto-generating an OpenAPI schema and playground. See OpenAPI with Aide for more information.
  • Roadster auto-generates a unique request ID for each request, if one wasn't provided in the request
  • Roadster configures the Tracing crate and enables instrumentation for requests. See Tracing for more information.