kacapower commited on
Commit
6c9afde
·
verified ·
1 Parent(s): 114cf9a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
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)