Newer
Older
python_redirect / router.py
@Jason Poage Jason Poage on 24 Mar 455 bytes First commit
"""
FastAPI routing configuration.
Maps incoming HTTP requests to the FastAPIProxyRedirect class.
"""

from fastapi import FastAPI, Request


from fast_api import FastAPIProxyRedirect

app = FastAPI()


@app.get("/{full_path:path}")
async def proxy_handler(request: Request):
    """
    Catch-all route that passes the request to the proxy logic and returns the response.
    """
    proxy = FastAPIProxyRedirect(request)
    return proxy.get_response()