A very basic Flask App
Folowed this tutorial.
To be used as demo for the email-postponer extension.
- Create and activate a virtual environment using the following command:
python3 -m venv venv
. venv/bin/activate
- Install Flask:
pip install flask
- Install CORS
pip install -U flask-cors
- Run the app:
export FLASK_APP=notes_app.py
flask run
-
App is running at http://127.0.0.1:5000/
-
You can curl:
curl -X PATCH http://127.0.0.1:5000/notes -H 'Content-Type: application/json' -d '{"url":"url3","title": "Created", "content": "Created a new note"}
'
curl -X POST http://127.0.0.1:5000/notes -H 'Content-Type: application/json' -d '{"url":"url3"}'
curl -X POST http://127.0.0.1:5000/notes -H 'Content-Type: application/json' -d '{}'