This a flask restful api created using flask web framework to management books as I learn to become a better software developer.
This project is using python3.6 and you need to create a virtual environment by running the following command:
virtualenv -p /usr/bin/python3.6 my_project
You can use also virtualenvwrapper.
To get the project run the following command:
git clone https://github.com/henrymbuguak/Flask-Book-Library.git
To install dependencies cd Flask-Book-Library and make sure your virtual environment is active. run the following command:
pip install -r requirements.txt
FLASK_APP=run.py FLASK_DEBUG=1 flask run
This are the endpoint I have today:
- show all books and create book: /api/books
- Edit book: /api/books/int:book_id
- delete a book: /api/books/int:book_id
- user register: /api/auth/register
- user login: /api/auth/login
- user logout: /api/auth/logout
Have a look at test_basic.py file to see how I am approaching unit test
To run the test run the following command: python -m unittest discover