- Install docker.
make db
- Install diesel-cli
cargo install diesel_cli --no-default-features --features=postgres
- Migrations
make diesel
DATABASE_URL=postgres://postgres:postgres@localhost:5432/people_db cargo run
-
1 GET /id where id is person id from DB
-
1 POST /new_person json as a body
-
1 PUT /id?name=&age= where id is person id from DB
-
1 DELETE /id where id is person id from DB
curl http://127.0.0.1:8000/1
curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "Juanes", "age": 55}' http://127.0.0.1:8000/new_person
note simple quotes in url because it has special characters !
curl -i -X PUT 'http://127.0.0.1:8000/1?name=Ayrat&age=30'
curl -i -X DELETE 'http://127.0.0.1:8000/1'