Git Product home page Git Product logo

doomsdaycoffeeapi's Introduction

Getting Started

  1. Install Docker

  2. Run docker

Starting API

To run the API locally, run the following command in the project directory.

docker-compose up --build

This will download and build all required files for the api.

You can check by going to:

http://localhost:8080/home

Going to this address should return a JSON file.

Stopping API

To stop the API run the following command.

docker-compose down --rmi all

This will stop all containers and remove them.

API Paths

Below is all the availible Paths and supported methods

/home Method: (get)

Going to http://localhost:8080/home will return a JSON array with each object containing the following attributes.

{
    "id":"hash",
    "taken_at_timestamp":"timestamp", 
    "display_url":"url to image", 
    "caption":"text for that image"
}

This collection will be autopopulated based on doomsday's instagram.

/foods Method: (get)

Going to http://localhost:8080/foods will return a JSON array with each object containing the following attributes.

{
    "id":"hash",
    "Name":"name of food", 
    "Price":"price for food", 
    "image":"image stored as base64",
    "ingredients":[
        "array", "of", "ingredients"
    ]
}

/drinks Method: (get)

Going to http://localhost:8080/drinks will return a JSON array with each object containing the following attributes.

{
    "id":"hash",
    "Name":"name of drink", 
    "Price":"price for drink", 
    "image":"image stored as base64",
    "ingredients":[
        "array", "of", "ingredients"
    ]
}

/food Method: (post)

Sending a POST request to http://localhost:8080/food with a JSON object will be saved to the food collections. Expected JSON structure.

{
    "Name":"name of food", 
    "Price":"price for food", 
    "image":"image stored as base64",
    "ingredients":[
        "array", "of", "ingredients"
    ]
}

/drink Method: (post)

Sending a POST request to http://localhost:8080/drink with a JSON object will be saved to the food collections. Expected JSON structure.

{
    "Name":"name of drink", 
    "Price":"price for drink", 
    "image":"image stored as base64",
    "ingredients":[
        "array", "of", "ingredients"
    ]
}

doomsdaycoffeeapi's People

Contributors

smartsnake avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.