-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Michael Pisman edited this page Oct 19, 2023
·
1 revision
For API configuration and settings we use Pydantic Settings module.
The configuration is loaded from environment variable and can be saved in .env
file for persistance.
For the convenience you can run interactive configuration wizard by running:
$ unipoll-api setup
Variables | Description | Default |
---|---|---|
ADMIN_EMAIL |
Email of the administrator of the application | [email protected] |
MONGODB_URL |
URL of the MongoDB database used by the application | mongodb://localhost:27017 |
SECRET_KEY |
Secrete key used for Authentication and Authorization | secret |
ORIGINS |
List of allowed origins for CORS | * |
HOST |
IP address to bind to | 0.0.0.0 |
PORT |
Port to bind to | 9000 |
RELOAD |
Enable auto-reload | True |
Host - IP address to bind to. Only IPv4 is supported for now.
Origins - List of allowed origins for CORS. The connections from other origins will be rejected. You can specify multiple origins by separating them with comma. For example: http://localhost:3000,http://localhost:3001
or use *
to allow all origins.
Reload - Enable auto-reload. This is useful for development. For production you should disable auto-reload. The reload will restart the server when any of the source files are changed.