this is the code of the simple api which uses api gateway, lambda.
This project provides an API for managing a bakery menu using AWS Lambda and PostgreSQL.
-
Clone the repository.
-
Install the required dependencies by running
pip install -r requirements.txt
. -
Configure the PostgreSQL database connection by setting the values for
username
,password
,host
,database
, andport
in thelambda_handler
function.
main.py
: Contains the Lambda function handler and the SQLAlchemy models for the bakery menu.
Retrieves all records from the bakery menu.
Creates a new record in the bakery menu. Provide the item
and date
parameters in the request body.
Updates an existing record in the bakery menu. Provide the id
, item
, and date
parameters in the request body.
Deletes a record from the bakery menu. Provide the id
parameter in the request body.
-
Send a GET request to
/menu
to retrieve all records from the bakery menu. -
Send a POST request to
/menu
with the following JSON body to create a new record: