Take portfolio offline with blank pages and blocked API routes

This commit is contained in:
StormRunner06106
2026-10-13 02:49:40 -07:00
parent 347ade6df7
commit 7fb83ea46c
6 changed files with 84 additions and 39 deletions
+16 -1
View File
@@ -61,7 +61,10 @@ app = FastAPI(
title="Alex Herlan Portfolio API",
description="Supabase-ready content and contact delivery for Alex Herlan's portfolio.",
version="1.1.0",
lifespan=media_cleanup.lifespan,
# The website is offline; do not start background storage cleanup.
docs_url=None,
redoc_url=None,
openapi_url=None,
)
origins = [
@@ -78,6 +81,18 @@ app.add_middleware(
)
@app.middleware("http")
async def site_offline(request: Request, call_next) -> Response:
"""Keep every page, API, and file unavailable without deleting stored data."""
return Response(
# A minimal document avoids the browser's built-in error screen.
content="<!doctype html><html><head><title></title></head><body></body></html>",
status_code=410,
media_type="text/html",
headers={"Cache-Control": "no-store", "X-Robots-Tag": "noindex, nofollow"},
)
class ContactPayload(BaseModel):
name: str = Field(min_length=2, max_length=100)
email: EmailStr