28 lines
561 B
Python
28 lines
561 B
Python
from fastapi import FastAPI, APIRouter, Request
|
|
from fastapi.templating import Jinja2Templates
|
|
from security import security_router
|
|
import uvicorn
|
|
|
|
app = FastAPI()
|
|
app.include_router(security_router)
|
|
|
|
templates = Jinja2Templates(directory="templates")
|
|
|
|
|
|
@app.get("/")
|
|
async def read_root(request: Request):
|
|
data = "hi"
|
|
return templates.TemplateResponse(
|
|
request=request,
|
|
name="index.html",
|
|
contents={"data": data}
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run(
|
|
"main:app",
|
|
host="0.0.0.0",
|
|
port=8080,
|
|
reload=True
|
|
)
|