> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/python/frameworks/fastapi/starting-fastapi.md).

# Starting FastAPI

* To start a FastAPI  app you will need to set up first a path operation

```python
# Import FastAPI framework
from fastapi import FastAPI

# Set up the App
app = FastAPI()

# Set up the path operation
@app.get("/")
async def root():
    return {"message": "Hello World"}
```

* Then you will have to run the <mark style="color:green;">uvicorn webserver</mark> by using the file name followed by the app name in said file

```python
uvicorn main:app

# If you get an error that uvicorn is not valid use:
python -m uvicorn main:app --reload
```

* This should return the information that the browser is running on local host

```bash
INFO:     Started server process [21240]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```

* Now you can access the API in the browser and see the message

![](/files/YOu95B8WJxx2sZtNjyPa)
