Rust backend starter with
- OpenAPI spec & swagger with rocket_okapi
- Postgres with diesel
- dotenv for config (for development)
Why? Because I happened to work through this and all the bits weren't immediately obvious.
-
Install diesel CLI with
cargo install diesel_cli --no-default-features --features postgres
-
Run the dev database with
docker-compose up -d
-
Run migrations with
diesel migration run
-
Install watchexec with
cargo install watchexec-cli
-
Start in dev mode with
watchexec --restart cargo run
-
Open up Swagger UI at http://localhost:8000/swagger