FastAPI-boilerplate icon indicating copy to clipboard operation
FastAPI-boilerplate copied to clipboard

Add CORS middleware and update documentation

Open rragundez opened this issue 2 months ago • 1 comments

Add CORS middleware by default as it is best practice. Then make it flexible in order for the user to follow advice in docs when in staging or production and instead of going into the source code, manipulate the CORS origins, methods and headers via the environment variables.

NOTE: I have not tested fully this change. I can do it tomorrow or if you can help validate, that would be great.

rragundez avatar Oct 22 '25 12:10 rragundez

@LucasQR test this one when possible

igorbenav avatar Nov 04 '25 00:11 igorbenav

@LucasQR test this one when possible

if it helps I have been using already

rragundez avatar Nov 15 '25 12:11 rragundez

@rragundez looks great! Can you please just update the readme (we changed the structure a lot), add example in the .env.example and maybe also in the docs? Then I can merge

igorbenav avatar Nov 16 '25 20:11 igorbenav

I'll make the requested changes and test the code a bit more so it can be merged

LucasQR avatar Nov 17 '25 18:11 LucasQR

I'll be adding a PR for environment variables of the backend and frontend host, this will make it easier for the user to specify the origins without hardcoding in the source code. In addition i also need these env variables for defining the redirect URLS when using oauth, and they are handy for other uses in an application backend.

rragundez avatar Nov 18 '25 04:11 rragundez