Installation • Serverless config • Commands
A simple Flasky app to save comments about topics deployed without cost using Serverless framework and AWS
Powered by #serverless, #aws and #flask
- Install Docker and Docker Compose
- Clone this project:
git clone https://github.com/bertini36/serverless-comments-engine
- Move to the project folder:
serverless-comments-engine
- Install all the dependencies and bring up the project with Docker executing:
make build
- Run the server:
make up
(by default Flask runs applications at 5000 port)
- Get comments
import requests
response = requests.get('http://127.0.0.1:5000/comments/topic')
- Register comment
import json
import requests
response = requests.post(
'http://127.0.0.1:5000/comments/topic',
json.dumps({'name': 'John Doe', 'email': 'john@doe.com', 'text': 'Ouh mama'}),
headers={'Content-Type': 'application/json'}
)
First set your AWS credentials and optionally, you can add a
Sentry DSN in .env
file.
cp .env-sample .env
After this, to deploy your lambda functions
make deploy
When deploy is finished you will see the app endpoints for get and add comments.
— Built with ❤️ from Mallorca —