Configuration
Configuration
Cooren reads its configuration from environment variables and core config files.
Start with the example below. Then check config.ts for the full list and defaults.
Key variables
These are the settings you will most likely change first:
PORTHTTP port for the APINODE_ENVRuntime mode likedevelopmentorproductionSERVER_ORIGINPublic server origin used for domain maskingCORS_ORIGINAllowed origins for CORSCORS_CREDENTIALSEnables or disables credential supportLOG_LEVELLogging verbosityENABLE_CACHEEnables Redis-backed cachingENABLE_RATE_LIMITINGEnables request rate limiting
Example .env
.envUse this as your base config:
Adjust these values for local, staging, and production separately.
Configuration groups
Server
PORTNODE_ENVSERVER_ORIGIN
These control runtime mode and server identity.
Logging
LOG_LEVEL
Use debug in development. Use warn or stricter in production.
Rate limiting and timeouts
RATE_LIMIT_PER_MINUTEENABLE_RATE_LIMITINGREQUEST_TIMEOUTPROXY_TIMEOUT_MSPROXY_MAX_RETRIES
These control request volume, retries, and timeout behavior.
CORS
CORS_ORIGINCORS_CREDENTIALS
Cooren uses @elysiajs/cors with this behavior:
If
CORS_ORIGINis*, all origins are allowedOtherwise,
CORS_ORIGINis split by commas and used as an allowlistCORS_CREDENTIALScontrols whether credentials are allowed
OpenAPI
OPENAPI_ENABLEDOPENAPI_VERSION
These control whether the API docs are exposed and which spec version is used.
Cache
ENABLE_CACHEDEFAULT_CACHE_TTLCACHE_PROVIDERREDIS_URLUPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN
Use default for a standard Redis connection.
Use Upstash variables when the cache provider is configured for Upstash.
Proxy behavior
SHOW_PROXIED_URL
This controls whether proxied URLs are exposed in responses or logs.
Reference docs
Use these if you need deeper details:
Full config reference
For the full list of supported variables and defaults, check the source in config.ts.
Last updated
