samuelsilvadev / drinks-api-py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drinks Storage

Simple API to manage drinks. 🤷‍♀️

Overview

Nothing much to say 😅

Installation

  1. Clone the repository:
git clone https://github.com/samuelsilvadev/drinks-api-py.git
  1. Navigate to the project directory:
cd drinks-api-py
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Unix-like systems
venv\Scripts\activate # On Windows
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Start the Flask server:
flask run
  1. The API should now be accessible at http://localhost:5000.

Endpoints

  • GET /drinks:

    • Description: Retrieve a list of drinks.
    • Parameters: None.
    • Body: None.
    • Response: JSON array of drinks objects.
  • GET /drinks/:id:

    • Description: Retrieve a unique drink.
    • Parameters: id.
    • Body: None.
    • Response: JSON dictionary of a drink.
  • POST /drinks:

    • Description: Create a new drink.
    • Parameters: None.
    • Body: JSON object representing a drink.
    • Response: JSON dictionary of the created drink.
  • PUT /drinks/:id:

    • Description: Update an existing drink.
    • Parameters: id.
    • Body: JSON object representing a drink.
    • Response: JSON dictionary of the created drink.
  • DELETE /drinks/:id:

    • Description: Delete a drink.
    • Parameters: id.
    • Body: None.
    • Response: None.

Contact

About


Languages

Language:Python 100.0%