From 866305d1db0a8217063e9a6f3f514d21e38e7242 Mon Sep 17 00:00:00 2001 From: newton-cn Date: Tue, 23 Apr 2024 18:41:25 +0900 Subject: [PATCH] =?utf8?q?index.html=20=EB=B7=B0=20=ED=85=8C=EC=8A=A4?= =?utf8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- app/main.py | 10 +++++----- templates/main/index.html | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 templates/main/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 -- 2.43.0