Python
Any .py file under api/ that defines an app (ASGI or WSGI) becomes a function.
from fastapi import FastAPI
app = FastAPI()
@app.get("/api/hello")
def hello():
return {"message": "Hello from Python"}Updated
Was this page helpful?
Any .py file under api/ that defines an app (ASGI or WSGI) becomes a function.
from fastapi import FastAPI
app = FastAPI()
@app.get("/api/hello")
def hello():
return {"message": "Hello from Python"}