Flask REST API pre-configured with Flask-SQLAlchemy, Flask-Serializer & Logging. This will get you up and running with CRUD operations quickly. Use this starter, boilerplate for all your new Flask projects.
- Python 3
- python3-virtualenv
- python3-pip
-
Clone the repo
git clone https://github.com/WMRamadan/flask-api-biolerplate cd flask-api-boilerplate
-
Initialize and activate a virtual environment:
virtualenv env source env/bin/activate
-
Install dependencies:
pip3 install -r requirements.txt
-
Run the development server:
python3 app.py
-
View the api at http://localhost:5000
Create Note:
curl -X POST http://localhost:5000/notes -H 'Content-Type: application/json' -d '{"note": "This is a note"}'
Get all Notes:
curl -X GET http://localhost:5000/notes
Get Note by ID:
curl -X GET http://localhost:5000/note/<note_id>
Delete Note by ID:
curl -X DELETE http://localhost:5000/note/<note_id>
Update Note by ID:
curl -X PUT http://localhost:5000/note/<note_id> -d '{"note": "This is an updated note"}'