| Crates.io | smart-fridge |
| lib.rs | smart-fridge |
| version | 2.0.0 |
| created_at | 2023-09-13 22:25:33.211746+00 |
| updated_at | 2023-10-04 20:55:49.940051+00 |
| description | A tiny service to manage food in your fridge |
| homepage | |
| repository | https://github.com/ValentinColin/smart-fridge |
| max_upload_size | |
| id | 972026 |
| size | 96,731 |
Before Running:
export DATABASE_PASSWORD=fridge
Then run:
docker compose up
Default environment variables per level:
| variables | application | docker compose | My env or .env |
|---|---|---|---|
| DATABASE_ADDR | db | db | localhost |
| DATABASE_NAME | postgres | postgres | |
| DATABASE_USERNAME | postgres | postgres | fridge |
| DATABASE_PASSWORD | fridge | ||
| WEB_APP_HOST | 0.0.0.0 | 127.0.0.1 | |
| WEB_APP_PORT | 80 | 8000 | |
| RUST_LOG | smart_fridge=debug |
| METHOD | ROUTE | DESCRIPTION | RETURN |
|---|---|---|---|
| GET | /api/v2/healthcheck | Used to check the health of the http server | (200, body: "OK") |
| GET | /api/v2/food | Get all row/food from the database | (200, body: JSON) or 500 |
| POST | /api/v2/food | Add food in the database | 204 or 500 |
| GET | /api/v2/food/:uuid | Get one row/food from the database | (200, body: JSON) or 500 |
| DELETE | /api/v2/food/:uuid | Delete on row/food in the database | 204 or 500 |
Build and open the doc in your browser
cargo doc --open
cli healthcheck
cli list
cli add <NAME> [<expiration_date>]
cli get <UUID>
cli delete <UUID>