Add Possibility for API prefix
Is it possible to add a prefix to the backend API to enable a reverse proxy filter to distinguish between frontend and backend requests without subdomains?
My understanding is that the backend can only be hosted on an additional domain. However, I need the backend to be under mydomain.com/api/some-endpoint and the frontend to be under mydomain.com.
Adding root_path="/api" should do the trick according to the fastapi docu: https://fastapi.tiangolo.com/advanced/behind-a-proxy/#checking-the-current-root_path
https://github.com/evroon/bracket/blob/a99ee6ca4a3dde70c5eb13c9f2f012756d512aa9/backend/bracket/app.py#L108-L119
The root path should be settable via an optional environment variable.