This project uses FastAPI and uvicorn to create a REST API for a library, with the following features:
- List all books
- Create a new book
- List a book by id
- Update a book by id
- Delete a book by id
What do you need to run this project?
For first, you need to install Python 3.8 or higher. You can download it from here.
Then, you need to install the dependencies. You can do it by running the following command:
$ pip install fastapi
---> 100%$ pip install uvicorn
---> 100%Now, to run it, you need to stay into the project folder and run the following command:
$ py main.py
Now, the API is running on your localhost by default with the port 7779.
You can acess the API documentation by accessing the following link: http://localhost:7779/docs
FastAPI will generate the documentation automatically.
You can test the API using Postman or Insomnia.
Enjoy it! :D