FastAPI

Lets run a hello world example from the FastAPI Quick start guide.

A minimal FastAPI application looks something like this and we will save in a file called main.py

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
async def root():
    return {"message": "Hello World"}

Open a terminal on your instance and run the below code.

uvicorn main:app --host 0.0.0.0 --port 6006

If your FastAPI is running then go to Jarvislabs.ai dashboard and click 👆 on the API button of your instance.

Jarvislabs.ai API endpoint

And start using it 😀.

Previous
Flask api
Next
Gradio