91fd0918c3
📌 Removed the wildcard (*) origin and replaced it with trusted origins from .env. 📌 Introduced environment variable (CORS_ALLOWED_ORIGINS) for dynamic origin management. 📌 Improved security by blocking untrusted origins and methods. 📌 Enhanced performance with maxAge for caching preflight responses. 📌 No breaking changes, as the fallback origin is set to http://localhost:4000 for development, ensuring compatibility with local setups.
7 lines
343 B
Bash
7 lines
343 B
Bash
DOMAIN = "aniwatchtv.to"
|
|
PORT = 4000
|
|
CORS_ALLOWED_ORIGINS = https://your-production-domain.com,https://another-trusted-domain.com
|
|
|
|
# RATE LIMIT
|
|
WINDOWMS = 1800000 # duration to track requests (in milliseconds) for rate limiting. here, 30*60*1000 = 1800000 = 30 minutes
|
|
MAX = 70 # maximum number of requests in this timeperiod |