From: newton-cn Date: Tue, 23 Apr 2024 09:41:25 +0000 (+0900) Subject: index.html 뷰 테스트 X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=866305d1db0a8217063e9a6f3f514d21e38e7242;p=back_nicezip_fastapi.git index.html 뷰 테스트 --- diff --git a/app/main.py b/app/main.py index 5d38a6b..1b5a1c4 100644 --- a/app/main.py +++ b/app/main.py @@ -19,11 +19,11 @@ templates= Jinja2Templates(directory= "templates") #exam = app.include_router(example.router) app.include_router(example.router) -# @app.get("/") -# async def index(request: Request): -# return templates.TemplateResponse( -# request= request, name= "main/index.html" -# ) +@app.get("/") +async def index(request: Request): + return templates.TemplateResponse( + request= request, name= "main/index.html" + ) if __name__ == '__main__': uvicorn.run(app= "main:app", host= "0.0.0.0", port= 33001, reload= True) diff --git a/templates/main/index.html b/templates/main/index.html new file mode 100644 index 0000000..0bab955 --- /dev/null +++ b/templates/main/index.html @@ -0,0 +1,21 @@ + + + + + + +
+

{{ message }}

+
+ + \ No newline at end of file