-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add CORS configuration #62
Conversation
app/config.py
Outdated
@@ -36,6 +36,7 @@ class Settings(BaseSettings): | |||
postgres_password: str | |||
postgres_host: str | |||
postgres_port: int = 5432 | |||
cors_allow_origins: list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you use a Field with a default factory here?
https://docs.pydantic.dev/latest/concepts/fields/#default-values
And you can use list[str]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you're right, I fixed it here : 0fa085b
this helped : https://docs.pydantic.dev/latest/concepts/pydantic_settings/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not yet a pro of these typings in python ^^
0fa085b
to
06b8470
Compare
What
https://fastapi.tiangolo.com/tutorial/cors/
app.py
.env