Skip to content

A Simple Flask REST API pre-configured with Flask-SQLAlchemy, Serializer, and Logging. This will get you up and running quickly.

License

Notifications You must be signed in to change notification settings

WMRamadan/flask-api-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Flask API Boilerplate

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.

Requirements

  • Python 3
  • python3-virtualenv
  • python3-pip

Quick Start

  1. Clone the repo

    git clone https://github.com/WMRamadan/flask-api-biolerplate
    cd flask-api-boilerplate
  2. Initialize and activate a virtual environment:

    virtualenv env
    source env/bin/activate
  3. Install dependencies:

    pip3 install -r requirements.txt
  4. Run the development server:

    python3 app.py
  5. View the api at http://localhost:5000

Performing CRUD Operations

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"}'

About

A Simple Flask REST API pre-configured with Flask-SQLAlchemy, Serializer, and Logging. This will get you up and running quickly.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages