Giter VIP home page Giter VIP logo

sample-rest-api's Introduction

Sample-REST-API

Using Flask to build a Python HTTP REST API.

Integrations with Flask-SQLalchemy.

Installation

Clone this repository:

$ git clone [email protected]:francRang/Sample-REST-API.git

From the directory from which this repo was cloned, go into the root directory for Sample-REST-API:

$ cd Sample-REST-API

Install with pip:

$ pip install -r requirements.txt

Create a .env file in the root directory of the flask application to specify the different secrets and configurations needed needed:

$ touch .env

Inside .env file:

SQLALCHEMY_DATABASE_URI='postgresql://user:password@localhost/somedb'
SQLALCHEMY_ECHO='False'
SQLALCHEMY_TRACK_MODIFICATIONS='False'
FLASK_DEBUG = 'False'

Flask Application Structure

.
|──────app/
| |────__init__.py
| |────routes.py
| |────models.py
| |────helpers.py
|──────.env
|──────.gitignore
|──────requirements.txt
|──────config.py
|──────run.py
|──────README.md

Run API:

Run flask

$ python3 run.py

The default port is 5000. Unless specified otherwise, this API will run locally:

http://127.0.0.1:5000/customers

or

http://localhost:5000/customers

sample-rest-api's People

Contributors

francrang 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.