<reponame>Remythellier/Wifi_bulk_RFID_scanner_for_in-store_checkout<filename>app/server.py
#!/usr/bin/env python

# Server
# __ Description: Rest server that gives status on GET at /status/ and sends the list of items in the cart before reseting the cart on GET at /42$cart
# __ Status: Prototype
# __ Author: <NAME>
# __ Email: <EMAIL>
# __ Licence: MIT

from flask import Flask, request
from flask_restful import Resource, Api

import cart_manager

app = Flask(__name__)
api = Api(app)

class getCart(Resource):
    def get(self):
        cart = cart_manager.get_cart()
        cart_manager.empty_cart()
        return {'cart': cart}

class getStatus(Resource):
    def get(self):
        return {'status': "live"}

api.add_resource(getCart, '/cart/')
api.add_resource(getStatus, '/')

def run():
    app.run(host="0.0.0.0", debug=False)

#!/usr/bin/env python

# Server
# __ Description: Rest server that gives status on GET at /status/ and sends the list of items in the cart before reseting the cart on GET at /42$cart
# __ Status: Prototype
# __ Author: <NAME>
# __ Email: <EMAIL>
# __ Licence: MIT

from flask import Flask, request
from flask_restful import Resource, Api

import cart_manager

app = Flask(__name__)
api = Api(app)

class getCart(Resource):
    def get(self):
        cart = cart_manager.get_cart()
        cart_manager.empty_cart()
        return {'cart': cart}

class getStatus(Resource):
    def get(self):
        return {'status': "live"}

api.add_resource(getCart, '/cart/')
api.add_resource(getStatus, '/')

def run():
    app.run(host="0.0.0.0", debug=False)
#!/usr/bin/env python # Server # __ Description: Rest server that gives status on GET at /status/ and sends the list of items in the cart before reseting the cart on GET at /42$cart # __ Status: Prototype # __ Author: <NAME> # __ Email: <EMAIL> # __ Licence: MIT