Giter Site home page Giter Site logo

backend2-flask-apis's Introduction

Restful APIs using flask

Run in Postman

Configuration to run locally

  1. Install dependencies:

    pip install -r requirement.txt
  2. Set environment variables:

    export FLASK_APP='backend2.py'
    export FLASK_APP='development'
    export DATABASE_URL="postgresql://<USER>:<PASSWORD>@localhost/backend2test"
  3. Initialise database:
    Database needs to be created before running the migration scripts. As postgres does not create a database if the database with given name doesn't exist.

    flask db init
    flask db migrate
    flask db upgrade

    As migrations are already part of the repository, there is no need for flask db init and flask db migrate.

  4. Run flask's development server

    flask run

Testing

Testing will require that the environment variable FLASK_APP=backend2.py is properly set. Testing will be done in an in-memory database, so no need to specify DATABASE_URL for that. Use flask test to run tests.

TODO:

  • - Add tests for start, stop.
  • - Deploy on cloud for remote usage
  • - Add API Documentation

backend2-flask-apis's People

Contributors

akashjobanputra avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.