Skip to content

pwx-app is a simple API allowing users to view, create, update and delete Categories and Products to generic marketplace.

Notifications You must be signed in to change notification settings

romuluc/pwx-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pwx-app

pwx-app is a simple API allowing users to view, create, update and delete Categories and Products to generic marketplace.

Requirements

  • Python 3
  • SQLite
  • Flask
  • Flask-SQLAlchemy
  • Flask-Admin
  • Flask-Migrate
  • Flask-Restless

Instructions to local deploy

$ git clone https://github.com/romuluc/pwx-app.git

$ cd pwd-app

$ pip install -r requirements.txt

$ export FLASK_CONFIG=development

$ export FLASK_APP=run.py

$ flask run

Usage (with curl tool)

  • Get categories
$ curl http://localhost:5000/api/category
  • Get specif category
$ curl http://localhost:5000/api/category/2
  • Post category
$ curl http://localhost:5000/api/category -H "Content-Type: application/json" -X POST -d '{"name":"Sanduíchess"}' -v
  • Update category
$ curl http://localhost:5000/api/category/5 -H "Content-Type: application/json" -X PUT -d '{"name":"Diversoss"}'
  • Delete category
$ curl http://localhost:5000/api/category/5 -X DELETE -v
  • Post product
$ curl http://localhost:5000/api/product -H "Content-Type: application/json" -X POST -d '{"name":"Refrigerente 2L", "price": 10.0, "category_id": 3}' -v
  • Search (Example: Searching products wich price greater than 10)
$ curl \
 -G \
 -H "Content-type: application/json" \
 -d "q={\"filters\":[{\"name\":\"price\",\"op\":\"ge\",\"val\":10}]}" \
 http://127.0.0.1:5000/api/product

About

pwx-app is a simple API allowing users to view, create, update and delete Categories and Products to generic marketplace.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published