Skip to content

Adapters

REROUTE adapters integrate file-based routing with different Python web frameworks.

Available Adapters

  • ⚡ FastAPI


    High-performance async framework with automatic API docs

  • Flask


    Lightweight and flexible WSGI framework

  • Django


    Full-featured framework (coming soon)

How Adapters Work

Adapters translate REROUTE's file-based routes into framework-specific routes:

from reroute.adapters import FastAPIAdapter

adapter = FastAPIAdapter(
    fastapi_app=app,
    app_dir=Path(__file__).parent / "app"
)
adapter.register_routes()

Common Features

All adapters support:

  • File-based routing discovery
  • HTTP method mapping (GET, POST, PUT, DELETE, etc.)
  • Lifecycle hooks (before_request, after_request, on_error)
  • Decorator integration
  • Custom configuration

Choosing an Adapter

Feature FastAPI Flask Django
Async Support Yes Partial Yes
Auto API Docs Yes No No
Performance Excellent Good Good
Learning Curve Medium Low High
REROUTE Support Full Full Coming Soon

Framework-Specific Guides

Custom Adapters

You can create custom adapters for other frameworks. See the API Reference for the adapter interface.