Skip to content

PugliaSOS/dovelobutto-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dovelobutto API

Hosted on https://dovelobutto.herokuapp.com

GET /products

Returns the first 10 products.

  • params:

    • name: filter by name.
  • return:

    The first 10 products found with the relative bin. If a name was specified and but product was found, the API will still return the product, with null as bin value.

E.g.:

GET https://dovelobutto.herokuapp.com/products?name=pla

Response:

{
    "data": [
        {
            "name": "pla",
            "bin": null
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "bicchieri di plastica"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "bottiglie di plastica"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "buste per alimenti in plastica"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "contenitori in plastica per uova"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "coperchi in plastica"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "piatti di plastica"
        },
        {
            "bin": {
                "id": 1,
                "name": "Indifferenziata"
            },
            "name": "posate di plastica"
        },
        {
            "bin": {
                "id": 1,
                "name": "Indifferenziata"
            },
            "name": "righelli in plastica"
        },
        {
            "bin": {
                "id": 4,
                "name": "Plastica e lattine"
            },
            "name": "sacchetti di plastica e nylon"
        }
    ]
}

POST /products

Submit a new products with the user email

  • params:
    • name: product's name
    • email: a valid email
  • returns:
    • 200: correctly submitted
    • 422: invalid request

E.g.:

POST https://dovelobutto.herokuapp.com/products

Body:

{
    "name": "test",
    "email": "[email protected]"
}

Response:

200 OK

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published