following along: dev.to/francescoxx/rust-crud-rest-api-3n45
- docker
- rust
DB_URL='postgres://postgres:postgres@db:5432/postgres' cargo build --release # build locally
docker compose -f docker-compose.yaml build app
docker compose -f docker-compose.yaml up -d # build and run via docker
docker compose -f docker-compose.yaml exec db psql -U postgres # connect to db
curl localhost:8080/users
curl localhost:8080/users/
curl -XGET localhost:8080/users
curl -XGET localhost:8080/users/
jq --null-input '{"name": "foo", "email": "foo@bar.baz"}' | curl -XPOST localhost:8080/users -d @-
jq --null-input '{"name": "max", "email": "max@bar.baz"}' | curl -XPUT localhost:8080/users/1 -d @-
curl -i -XDELETE localhost:8080/users/3