Spaces:
Sleeping
Sleeping
ZakharZokhar
commited on
Commit
•
c73e7bc
1
Parent(s):
1299710
Update main.py
Browse files
main.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from fastapi import FastAPI, HTTPException, Body
|
2 |
from pydantic import BaseModel
|
3 |
from fastapi.templating import Jinja2Templates
|
4 |
import os
|
@@ -15,7 +15,7 @@ templates = Jinja2Templates(directory="templates")
|
|
15 |
|
16 |
# Главная страница с текстом "server is running"
|
17 |
@app.get("/")
|
18 |
-
async def read_root():
|
19 |
return templates.TemplateResponse("index.html", {"text": "server is running"})
|
20 |
|
21 |
# Определяем единственный POST endpoint
|
|
|
1 |
+
from fastapi import FastAPI, HTTPException, Body, Request
|
2 |
from pydantic import BaseModel
|
3 |
from fastapi.templating import Jinja2Templates
|
4 |
import os
|
|
|
15 |
|
16 |
# Главная страница с текстом "server is running"
|
17 |
@app.get("/")
|
18 |
+
async def read_root(request: Request):
|
19 |
return templates.TemplateResponse("index.html", {"text": "server is running"})
|
20 |
|
21 |
# Определяем единственный POST endpoint
|