Skip to content

milobella/connector-shopping

Repository files navigation

Shopping list (Shopito)

Shopito is a REST web service which permits to manage a shopping list with a mongodb database.

Prerequisites

  • Having access to gitlab.milobella.com
  • Having python 3.6 installed instructions
  • Having pip3 installed (Starting with Python 3.4, it is included by default with the Python binary installers)
  • [optional] Having python virtual environment instructions

Installation

$ pip install -r requirements.txt
$ pip install --upgrade .

Run

Run the database

$ docker-compose up -d

Run the project

$ shoppinglist_launcher

Requests examples

Add item(s)

$ curl -i -X PUT http://localhost:4848/items -d '[{"item": "carotte"}, {"item": "pain"}]'
HTTP/1.1 204 No Content
Connection: keep-alive
Keep-Alive: 5
Content-Type: text/plain; charset=utf-8

Get all items

$ curl -i -X GET http://localhost:4848/items
HTTP/1.1 200 OK
Connection: keep-alive
Keep-Alive: 5
Content-Length: 346
Content-Type: application/json

[{"_id": {"$oid": "5cca0253f8427964e257db5e"}, "item": "carotte", "user_id": "default"}, {"_id": {"$oid": "5cca0253f8427964e257db5f"}, "item": "pain", "user_id": "default"}]

Delete all items

$ curl -i -X DELETE http://localhost:4848/items
HTTP/1.1 204 No Content
Connection: keep-alive
Keep-Alive: 5
Content-Type: text/plain; charset=utf-8

CHANGELOGS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published