Simple API to manage drinks. 🤷♀️
Nothing much to say 😅
- Clone the repository:
git clone https://github.com/samuelsilvadev/drinks-api-py.git
- Navigate to the project directory:
cd drinks-api-py
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Unix-like systems
venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Start the Flask server:
flask run
- The API should now be accessible at
http://localhost:5000
.
-
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.