This repository contains a serverless web application built with Python and AWS Lambda. The application demonstrates a simple CRUD (Create, Read, Update, Delete) functionality using AWS Lambda functions and Amazon DynamoDB.
Before you can run this application, make sure you have the following installed:
Additionally, you need to have an AWS account and configure your AWS CLI with your credentials.
Clone the repository:
git clone https://github.com/icode247/python_serverless_app.git
cd python_serverless_app
pip install -r requirements.txt
sls deploy
This command will create the necessary AWS resources, such as Lambda functions and a DynamoDB table. Note the API endpoint displayed in the output after the deployment is complete.
To test the application locally, use the Serverless Offline plugin:
sls offline
This command will start a local server on port 3000
by default. You can test your Lambda function by making a request to the local endpoint:
curl http://localhost:3000/dev/items/{id}
To stop the local server, press Ctrl + C
in the terminal.
After deployment, you can test the application using the API endpoint provided in the deployment output. Use the following command, replacing your-api-endpoint with the actual API endpoint:
curl https://your-api-endpoint.amazonaws.com/dev/items/{id}
To remove the deployed AWS resources, run the following command:
sls remove
This will delete the Lambda functions, DynamoDB table, and other resources created during deployment.
Feel free to submit issues, fork the repository, and create pull requests to contribute to the project.