Developed following the book Zero To Production In Rust using axum.
A summary of the differences:
- §3.3: the chosen web framework is axum;
- §3.5: hyper is used as HTTP client;
- §3.8: docker compose is used to setting up the test environment:
$ docker compose -f docker-compose.test.yml -p zero2prod up -d $ sqlx database reset -y
- §3.9:
axum::State
is used as type safe replacement ofaxum::Extension
and?
operator is used to handle errors; - §4.5: traces are collected using Grafana Tempo and they can be inspected using Grafana at the address
http://localhost:3000
; - §5.3: hierarchical configuration is not implemented, configuration can be customized using environment variables; database migrations can be executed on service startup;
- §6.8: unmaintained project claim is replaced with claym;
- §6.10: error 422 Unprocessable Entity is used to notify a syntatically correct request, but semantically erroneous;
- §7.2: hyper is used as HTTP client, HTTP client timeout can be configured using humantime;
- §7.8: routes are refactored exploiting that
Result
implementsIntoResponse
.