This is an example Rust REST API using Tide and SQLX.
To run you must have rust installed.
- Run
docker-compose up
to start Postgres database - Use
cargo run
to start API - Make a POST request to
http://localhost:8181/pet
with a request body (shown below) to add a pet - Make a GET request to
http://localhost:8181/pets
to get a list of pets - Make a GET request to
http://localhost:8181/pet/:id
to get an individual pet
Example request body to add a pet (an additional tag field is optional)
{
"id": 1,
"name": "Ben"
}
Make a GET request to http://localhost:8181/oas
for the full API schema
Use cargo test
to run tests