Nkoe means tiger in Sesotho 🐯
A basic aiohttp server which implement few endpoints. This project was made with educational purpose so those are some basic things.
Here it's a documentation made in postman.
As exercise you must add request with documentation for endpoint Add vaccine to a cat
. You can choose any cat you want.
- First you need some tools:
- Installation:
- Clone project locally;
- Install dependencies with
poetry install
; - Take a look at
.example.env
to see if you must configure something; - Now run server with the following command:
poetry run server
;
I assume you already have installed and setup postman locally; Note I recommend to create a new workspace to avoid overwriting existing things!
For collection: Open postman and from left upper corner select import
and then Import from link
and put this link: https://www.getpostman.com/collections/33c1efb9969544146bf9.
For environment: In this repository you will find a folder named docs
. Open postman select from left upper corner import
and then Import folder
and just drag and drop that folder.
For globals: From right upper corner click on that eye
, go with mouse on globals row and press edit, in that table add a new row with: Variable = username, Initial value = [your name], Current Value = [leave it blank], and press save.
Forlocal
environment I suppose you will run your server on port8080
and forqa
on port8081
.
ENDPOINT | METHOD | DESCRIPTION |
---|---|---|
Base | ||
.../ |
GET | overview 📓 |
Auth | ||
.../login/ |
POST | Create token ➕ |
.../logout/ |
POST | Delete token ➖ |
Cats | ||
.../cats/ |
GET | Get all cats 😸 |
.../cats/ |
POST | Create new cat 😻 |
.../cats/{cat_pk}/ |
GET | Get info for a specific cat 🐱 |
.../cats/{cat_pk}/ |
PUT | Update information about a cat 😼 |
.../cats/{cat_pk}/ |
DELETE | Delete a cat 😿 |
.../cats/{cat_pk}/vaccine |
POST | Add a vaccine to a cat 🙀 |