ms180 commited on
Commit
c0040f8
1 Parent(s): 493fbf6

Modified app.py

Browse files
Files changed (1) hide show
  1. modules/app.py +6 -3
modules/app.py CHANGED
@@ -1,11 +1,14 @@
1
  from fastapi import FastAPI
2
  from fastapi.staticfiles import StaticFiles
 
3
 
4
  app = FastAPI()
5
 
6
  app.mount("/static", StaticFiles(directory="static"), name="static")
7
  app.mount("/", StaticFiles(directory="template", html=True), name="html")
8
 
9
- # @app.get("/")
10
- # async def root():
11
- # return {"message": "Hello World"}
 
 
 
1
  from fastapi import FastAPI
2
  from fastapi.staticfiles import StaticFiles
3
+ from fastapi.responses import FileResponse
4
 
5
  app = FastAPI()
6
 
7
  app.mount("/static", StaticFiles(directory="static"), name="static")
8
  app.mount("/", StaticFiles(directory="template", html=True), name="html")
9
 
10
+
11
+ @app.head("/")
12
+ @app.get("/")
13
+ def index() -> FileResponse:
14
+ return FileResponse(path="/index.html", media_type="text/html")