fastapi-freeze blog A FastAPI app, frozen to static files.

What freezing a FastAPI app means

This blog is a FastAPI app. When it runs live, each page is rendered by a route function, like any other FastAPI app. What you are reading now, though, is a plain HTML file on GitHub Pages. No Python is running.

fastapi-freeze made that file. It reads the app's OpenAPI schema to find the HTML GET routes, works out every URL each route can answer, requests each URL once, and writes the response to disk:

/                    -> index.html
/posts/<slug>/       -> posts/<slug>/index.html
/list/newest/        -> list/newest/index.html

Each file sits at the same path as the URL, so the static host answers the same URLs as the live app. Any HTTP client can fetch them: a browser, curl, a crawler, or HTMX.

That only works if the set of URLs is finite. The next posts show the two ways a route gets there.

All posts