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.
Here's a simple example of how you can create a web server using the FastAPI framework in Python to return the text "Hello, World!" as an HTML heading of type h1:

from fastapi import FastAPI
from fastapi.responses import HTMLResponse

app = FastAPI()

@app.get("/")
def hello_world():
    content = "<h1>Hello, World!</h1>"
    return HTMLResponse(content=content)

In this example, we first import the required modules FastAPI and HTMLResponse from the fastapi library. We then create an instance of the FastAPI class and assign it to a variable named app.

Next, we define a function named hello_world that returns an HTMLResponse with the content "Hello, World!" formatted as an h1 heading.

Finally, we decorate the hello_world function with the @app.get("/") decorator, which binds the function to the root route of the web server (i.e. the home page). When a user loads the website in a web browser and makes a GET request to the root route, the hello_world function will be executed and its response will be returned to the user.