/flask-rest-api

:postbox: :email: :elephant: Flask REST API example with PostgreSQL database.

Primary LanguagePython

Flask REST API

Requeriments

  • Python 3.x
  • PostgreSQL database
  • virtualenv

Install requeriments

pip install -r requirements.txt

Run migrations

  • python migrate.py db init
  • python migrate.py db migrate
  • python migrate.py db upgrade

Run API

python run.py

API ENDPOINTS

  • GET - /api/Category - Retrieve all categories
  • POST - /api/Category - Add a new category
  • PUT - /api/Category - Update a category
  • DELETE - /api/Category - Delete a category
  • GET - /api/Comment - Retrieve all the stored comments
  • POST - /api/Comment - Add new comment