- Python
- Code Editor (recommendation: VSCode)
- Git (alternatively you can download project as a zip from https://github.com/bradenhs/python-webserver/archive/refs/heads/main.zip)
Run this (one line at a time) in your terminal:
git clone https://github.com/bradenhs/python-webserver.git
code python-webserver
Follow VSCode's prompt to install some extensions if you don't already have them.
Open a VSCode terminal to run these commands.
python3 -m venv venv
source venv/bin/activate
This allows you to have individual dependencies installed per project.
pip install -r requirements.txt
Once in the virtual environment this command will install project dependencies in the ./venv
directory.
flask --app server run
It will start on http://localhost:5000
python3 ./client.py
Make a couple sample calls to the server from a Python script.
open http://localhost:5000
Interact with the API via a web page.