example rust api
This is an example Rust REST API using Tide and SQLX.
To run you must have rust installed.
docker-compose up
to start Postgres databasecargo run
to start APIhttp://localhost:8181/pet
with a request body (shown below) to add a pethttp://localhost:8181/pets
to get a list of petshttp://localhost:8181/pet/:id
to get an individual petExample 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