INFO 153B/253B: Backend Web Architecture
Kay Ashaolu
pip3 install flask
# webserver.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return "Hello World!"
# Open a terminal and navigate to the folder where you have saved
# your server code
python3 -m flask --app webserver run --host=0.0.0.0 --port=5050
python -m: gives you the ability to run a specific module (e.g. file) that has been already installed (via pip3 or in the PYTHONPATH)
@app.route('/')
def hello_world():
return "Hello World!"