Home

Flask Hello World

Resources

  1. Parsing JSON data w/ Flask
  2. Status codes in Flask
  3. Python Try/Except

Prereqs

pip install Flask

The Basic Code

First, create hello.py.

from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run()

Now run python hello.py in the terminal. Once the server is up and running you can curl http://localhost:5000.

Repository

https://github.com/okeeffed/developer-notes-nextjs/content/flask/hello-world

Sections


Related