INNER CODE UNIT · Python
StorageBackendMismatchError
shenmintao/marginalia · src/marginalia/main.py:204
class StorageBackendMismatchError(RuntimeError):
pass
app = FastAPI(title="Marginalia", lifespan=lifespan)
# Browser-based GUI (desktop/) runs on Vite dev server (5173) or via
# Tauri (tauri://localhost). Both differ in origin from the API host
# and need CORS to read responses; the CLI client (httpx ASGITransport
# or remote-mode httpx) bypasses the browser stack and is unaffected.
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://localhost:5173",
"http://127.0.0.1:5173",
"http://localhost:1420",
"tauri://localhost",
# Tauri 2's webview origin varies by platform: macOS uses