Home    Articles

 

Python: Simple Flask server example

 

This is a simple Python 3 flask server example:

from flask import Flask
from flask import request
app = Flask(__name__)

@app.route('/',methods=['POST','GET'])
def main():
    return "<b>Hello World</b>"

app.run()

Then you open this in your browser: http://127.0.0.1:5000/

by