Back to all posts
fastapi programming python

FastAPI Quick Start

0 min read (49 words)

Short and easy FastAPI startup for a quick playground and testing.

pip install fastapi
pip install uvicorn

-- main.py --

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.get("/hello")
def read_root():
    return {"Hello": "Hello"}

To start using uvicorn:

uvicorn app.main:app --host 127.0.0.1 --port 8089
FastAPI basic setup demonstration showing Hello World endpoint implementation and uvicorn server configuration
Dmitry Golovach
About

Dmitry Golovach

Principal Network Engineer and AI enthusiast. Always learning, always building.

Share this post

All posts