Giter Club home page Giter Club logo

rest_api's Introduction

Description

REST api to access the resources:

  • Accounts
  • Malls
  • Units

Where each mall is linked to a an account and each unit is linked to an account.

To set up and launch the app

git clone [email protected]:ThourayaBchir/rest_api.git
cd rest_api

python3 -m venv api_venv 
source api_venv/bin/activate
pip install -r requirements.txt

flask init-db
python populate_db.py

To run the app

python rest_api.py

or

flask run

To run tests

tox

Some examples to query

curl "http://localhost:5000/api/v1.0/accounts/1/malls/1/units"  -d "name=unit_name&mall_id=1" -X POST -v

curl "http://localhost:5000/api/v1.0/accounts"   -X GET -v

curl "http://localhost:5000/api/v1.0/accounts/1"   -X GET -v

curl "http://localhost:5000/api/v1.0/accounts/1" -d "name=account_update_name"  -X PUT -v

curl "http://localhost:5000/api/v1.0/accounts/1/malls/1" -d "name=mall_update_name&account_id=1"  -X PUT -v

curl "http://localhost:5000/api/v1.0/malls/1" -d "name=mall_update_name2&account_id=1"  -X PUT -v

rest_api's People

Contributors

thourayabchir avatar

Watchers

 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.