Danisz commited on
Commit
7d94d26
·
1 Parent(s): 8bc7e6c

Attempt fix HTTPS

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -128,10 +128,7 @@ UPLOAD_DIRECTORY = os.path.join(os.getcwd(), "uploaded_files")
128
 
129
  @app.get("/", response_class=HTMLResponse)
130
  async def serve_main_page(request: Request):
131
- # Get the base URL dynamically
132
- base_url = str(request.base_url).rstrip('/')
133
-
134
- html_content = f"""
135
  <!DOCTYPE html>
136
  <html lang="en">
137
  <head>
@@ -139,24 +136,24 @@ async def serve_main_page(request: Request):
139
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
140
  <title>Audio Recorder App</title>
141
  <style>
142
- body, html {{
143
  margin: 0;
144
  padding: 0;
145
  height: 100%;
146
  overflow: hidden;
147
- }}
148
- #flet-app-frame {{
149
  width: 100%;
150
  height: 100%;
151
  border: none;
152
  position: absolute;
153
  top: 0;
154
  left: 0;
155
- }}
156
  </style>
157
  </head>
158
  <body>
159
- <iframe id="flet-app-frame" src="{base_url}/flet-app"></iframe>
160
  <iframe name="hidden-iframe" style="display:none;"></iframe>
161
  </body>
162
  </html>
 
128
 
129
  @app.get("/", response_class=HTMLResponse)
130
  async def serve_main_page(request: Request):
131
+ html_content = """
 
 
 
132
  <!DOCTYPE html>
133
  <html lang="en">
134
  <head>
 
136
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
137
  <title>Audio Recorder App</title>
138
  <style>
139
+ body, html {
140
  margin: 0;
141
  padding: 0;
142
  height: 100%;
143
  overflow: hidden;
144
+ }
145
+ #flet-app-frame {
146
  width: 100%;
147
  height: 100%;
148
  border: none;
149
  position: absolute;
150
  top: 0;
151
  left: 0;
152
+ }
153
  </style>
154
  </head>
155
  <body>
156
+ <iframe id="flet-app-frame" src="./flet-app"></iframe>
157
  <iframe name="hidden-iframe" style="display:none;"></iframe>
158
  </body>
159
  </html>