Skip to content

skliarpawlo/sample

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork this project and send us a pull request

Write a simple python webservice that returns the objects & manipuates the data found here http://www.unisport.dk/api/sample/.

/products/

should return the first 10 objects ordered with the cheapest first.

/products/kids/

should return the products where kids=1 ordered with the cheapest first

/products/?page=2

The products should be paginated where page in the url above should return the next 10 objects

/products/id/

should return the individual product.

Remember to test
Remember to document (why, not how)

####Bonus: extend the service so the products can also be created, edited and deleted in a backend of choice.

You are welcome to use any thirdparty python web framework or library that you are familiar with.

####Installation: pip install -r requirements.txt

Run:

python run.py

it should start service on localhost:5000

Try it:

curl -X GET http://localhost:5000/products/ curl -X GET http://localhost:5000/products/kids/ curl -X GET http://localhost:5000/products/103897/ curl -X DELETE http://localhost:5000/products/103897/ curl -X PUT http://localhost:5000/products/1/?price=12 curl -X POST http://localhost:5000/products/1/?price=12

About

Fork this and send back a pull request

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%