运行

$export FLASK_APP=hello.py
$export FLASK_ENV=development
$flask run --host=0.0.0.0

# win
python -m flask run -h 0.0.0.0 -p 5000

# linux
flask run --host=0.0.0.0 --port=5001

Route

@app.route('/')
def index():
    return 'Index Page'

@app.route('/hello')
def hello():
    return 'Hello, World'