Calmcode - fastapi: hello world

Install and run your first FastAPI app.

1 2 3 4 5 6 7 8 9

FastApi is an enjoyable tool for building web applications in python. In these videos we demonstrate the main features.

Before you can use it, you'll need to install the dependencies.

pip install fastapi uvicorn

From here, this is all we have in our app.py file.

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def root():
    return {"message": "hello world again"}

To start the server locally you need to run;

uvicorn app:app --reload

If you don't pass the --reload flag then the app won't restart when you update.