Skip to content

Instantly share code, notes, and snippets.

@vrslev
vrslev / main.py
Last active November 3, 2024 15:35
Automatic browser reloading in FastAPI
import os
import arel
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates("templates")
if _debug := os.getenv("DEBUG"):