This PR adds support for configuring CORS allowed origins from the .env file. Instead of hardcoding the origins in the code, the backend can now dynamically read the origins from the environment, making it easier to manage in different environments (development, staging, production).
Changes:
Reads the ALLOWED_ORIGINS variable from the .env file.
Splits the comma-separated list of origins and parses them into a Vec<String>.
Description
This PR adds support for configuring CORS allowed origins from the
.env
file. Instead of hardcoding the origins in the code, the backend can now dynamically read the origins from the environment, making it easier to manage in different environments (development, staging, production).Changes:
ALLOWED_ORIGINS
variable from the.env
file.Vec<String>
.CorsLayer
with the parsed origins.Example
.env
configuration: