![]() ![]() Which should result in the following response: InvocationĪfter successful deployment, you can call the created application via HTTP: curl For details on how to do that, refer to httpApi event docs. For production deployments, you might want to configure an authorizer. Note: In current form, after deployment, your API is public and can be invoked by anyone. ✔ Service deployed to stack aws-python-flask-api-project-dev (182s)Īpi: aws-python-flask-api-project-dev-api (1.5 MB) In order to deploy with dashboard, you need to first login with: serverless loginĪnd then perform deployment with: serverless deployĪfter running deploy, you should see output similar to: Deploying aws-python-flask-api-project to stage dev (us-east-1) This example is made to work with the Serverless Framework dashboard, which includes advanced features such as CI/CD, monitoring, metrics, etc. For details on that, please refer to corresponding GitHub repository. venvĪlternatively, you can also use dockerizePip configuration from serverless-python-requirements. You can create and activate a dedicated virtual environment with the following command: python3.8 -m venv. In order to package your dependencies locally with serverless-python-requirements, you need to have Python3.8 installed locally. For more details about serverless-python-requirements configuration, please refer to corresponding GitHub repository. Additionally, the template relies on serverless-python-requirements plugin for packaging dependencies from requirements.txt file. To learn more about serverless-wsgi, please refer to corresponding GitHub repository. The implementation takes advantage of serverless-wsgi, which allows you to wrap WSGI applications such as Flask apps. As the events are configured in a way to accept all incoming requests, Flask framework is responsible for routing and handling requests internally. ![]() To learn more about httpApi event configuration options, please refer to httpApi event docs. This template configures a single function, api, which is responsible for handling all incoming requests thanks to configured httpApi events. This template demonstrates how to develop and deploy a simple Python Flask API service running on AWS Lambda using the traditional Serverless Framework. ![]() Serverless Framework Python Flask API on AWS ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |