Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Response
|
| 2 |
+
from fastapi.responses import HTMLResponse
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
@app.get("/")
|
| 8 |
+
async def serve_frontend(response: Response):
|
| 9 |
+
# Read your HTML file
|
| 10 |
+
with open("index.html", "r", encoding="utf-8") as f:
|
| 11 |
+
html_content = f.read()
|
| 12 |
+
|
| 13 |
+
# Explicitly allow iframe embedding on all domains (including Blogger)
|
| 14 |
+
headers = {
|
| 15 |
+
"X-Frame-Options": "ALLOWALL",
|
| 16 |
+
"Content-Security-Policy": "frame-ancestors *;"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
return HTMLResponse(content=html_content, headers=headers)
|