Name | Description | Default |
---|---|---|
BIND__HOST | Host to listen on | 127.0.0.1 |
BIND__PORT | Port to bind to | 8000 |
DB__URI | Database URI | |
DB__TYPE | The type of database (sqlite, postgres) | |
DATA__RECIPE_IMAGES_BASE | Where recipe images will be stored | |
JWT_SECRET | base64 encoded secret for JWT authentication tokens | |
STATIC_PATH | Serve static files at / (e.g. the frontend) | - |
CORS_ORIGINS | List of origins that may access the API | * |
OPTIMIZED_IMAGE_SIZE | Max image size to shrink uploaded image to | 2000 |
MAX_UPLOAD_SIZE | The max possible upload size | 4M |
# sqlite
./data/db.sqlite
# postgres
host=localhost user=user password=password dbname=my_cooking_codex port=9920 sslmode=disable TimeZone=Europe/London
- Database (SQLite, PostgreSQL)
- libvips installed
- go >= 1.20
Run these commands:
go build
Copy built binary ./api
and run.