Create a simple web server using the Python framework FastAPI that returns "Hello, world!" to the user upon loading the website in a web browser. The text should be formatted as an HTML heading of type h1.
user
Here's an example implementation:

```
python

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "<h1>Hello, world!</h1>"}
```

You can run this server by executing the code in a Python environment and then visiting http://localhost:8000 in your web browser.
assistant
How can I extend this website to serve as a local (non-cloud) media library for my home?
user
In order to extend this application to serve as a media library for your home, you would need to determine what media types you want to serve and where they are located. 

Assuming all your files are located in a directory called `media` and that you are okay relying on the web browser's default display for your files, the following code would allow your files to be accessible from your local network:

```python
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles

app = FastAPI()

app.mount("/", StaticFiles(directory="media"), name="media")

```

This will only be accessible on your local network. You may need to configure firewall rules and port forwarding to make this accessible outside your home.
assistant