bracket icon indicating copy to clipboard operation
bracket copied to clipboard

Add Possibility for API prefix

Open TheMrPhantom opened this issue 5 months ago • 1 comments

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.

TheMrPhantom avatar Jul 19 '25 18:07 TheMrPhantom

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.

TheMrPhantom avatar Jul 19 '25 18:07 TheMrPhantom