Hatman commited on
Commit
74cf889
·
verified ·
1 Parent(s): e861fa2

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +41 -8
main.py CHANGED
@@ -1,11 +1,44 @@
1
- FROM python:3.12
 
2
 
3
- WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
-
9
- COPY . .
10
-
11
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from fastapi.responses import HTMLResponse
3
 
4
+ app = FastAPI()
5
 
6
+ @app.get("/", response_class=HTMLResponse)
7
+ async def read_root():
8
+ html_content = """
9
+ <!DOCTYPE html>
10
+ <html>
11
+ <head>
12
+ <title>Fullscreen IFrame</title>
13
+ <style>
14
+ html, body {
15
+ margin: 0;
16
+ padding: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ overflow: hidden;
20
+ }
21
 
22
+ iframe {
23
+ position: fixed;
24
+ top: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ border: none;
29
+ margin: 0;
30
+ padding: 0;
31
+ overflow: hidden;
32
+ }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <iframe
37
+ src="YOUR_URL_HERE"
38
+ allowfullscreen
39
+ frameborder="0"
40
+ ></iframe>
41
+ </body>
42
+ </html>
43
+ """
44
+ return HTMLResponse(content=html_content)