Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,16 +13,18 @@ MTMODELS = {'enro': 'BlackKakapo/opus-mt-en-ro',
|
|
| 13 |
@app.get("/")
|
| 14 |
def index(request: Request):
|
| 15 |
from fastapi.responses import HTMLResponse
|
| 16 |
-
host_url =
|
| 17 |
html_content = f'''
|
| 18 |
<html>
|
| 19 |
<head>
|
| 20 |
-
<title>
|
| 21 |
</head>
|
| 22 |
<body>
|
| 23 |
-
<h1>FastAPI
|
| 24 |
<p>Host URL: {host_url}</p>
|
| 25 |
-
<a href="{host_url}/docs">DOCS</a>
|
|
|
|
|
|
|
| 26 |
</body>
|
| 27 |
</html>
|
| 28 |
'''
|
|
|
|
| 13 |
@app.get("/")
|
| 14 |
def index(request: Request):
|
| 15 |
from fastapi.responses import HTMLResponse
|
| 16 |
+
host_url = "https://" + request.url.netloc
|
| 17 |
html_content = f'''
|
| 18 |
<html>
|
| 19 |
<head>
|
| 20 |
+
<title>FastAPI with MCP</title>
|
| 21 |
</head>
|
| 22 |
<body>
|
| 23 |
+
<h1>FastAPI URLS</h1>
|
| 24 |
<p>Host URL: {host_url}</p>
|
| 25 |
+
<p><a href="{host_url}/docs">DOCS</a></p>
|
| 26 |
+
<p><a href="{host_url}/redoc">REDOC</a></p>
|
| 27 |
+
<p><a href="{host_url}/openapi.json">openapi.json</a></p>
|
| 28 |
</body>
|
| 29 |
</html>
|
| 30 |
'''
|