-
Create a Flask API
- You can choose what it does!
- Your API should respond to at least one GET and one POST request
- Add at least one extension eg. a database connection or an email service
- Follow documentation to add some tests using pytest
-
Prepare a short (3-5 minute) demonstration of your new API
- Focus on demonstrating your API's functionality
- You could demonstrate using curl, Hoppscotch, a custom client or a combination!
cd flask-demo
pipenv install -r requirements.txt
pipenv shell
- Tell terminal which application to work with:
export FLASK_APP=server.py
(Linux/MacOS/GitBash)set FLASK_APP=server.py
(Windows Command Prompt)$env:FLASK_APP = "server.py"
(PowerShell)
- Tell terminal which environment to work in:
export FLASK_ENV=development
(Linux/MacOS/GitBash)set FLASK_ENV=development
(Windows Command Prompt)$env:FLASK_ENV="development"
(PowerShell)
flask run