RESTful Rust Todo service
Start Postgres DB
docker-compose --profile infra up -dRun the SQL migration
diesel migration runRun todoservice
cargo run --releaseRun the tests
cargo testStart Jaeger all-in-one docker container
docker-compose --profile tracing up -dOpen Jaeger UI on http://localhost:16686/
curl --location 'http://localhost:8080/todo' \
--header 'Content-Type: application/json' \
--data '{
"title":"title text",
"body":"body text"
}'200 OK
{
"id": 1,
"title": "title text",
"body": "body text",
"completed": false
}curl --location 'http://localhost:8080/todo/1'200 OK
{
"id": 1,
"title": "title text",
"body": "body text",
"completed": false
}curl --location --request DELETE 'http://localhost:8080/todo/1'200 OK - (Empty response body)
curl --location 'http://localhost:8080/todo'200 OK
[
{
"id": 1,
"title": "title text",
"body": "body text",
"completed": false
},
{
"id": 2,
"title": "a todo",
"body": "a todo",
"completed": true
},
{
"id": 3,
"title": "Clean out your car",
"body": "busywork",
"completed": true
}
]curl --location --request POST 'http://localhost:8080/todo/random'200 OK
{
"id": 3,
"title": "Clean out your car",
"body": "busywork",
"completed": false
}curl --location --request PUT 'http://localhost:8080/todo/3'200 OK
{
"id": 3,
"title": "Clean out your car",
"body": "busywork",
"completed": true
}Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repo by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.