kkk2z1 commited on
Commit
d8ca21a
Β·
verified Β·
1 Parent(s): 1822c44

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from fastapi.staticfiles import StaticFiles
3
+ from fastapi.responses import FileResponse
4
+
5
+ app = FastAPI()
6
+
7
+ # /file γ‚’ι™ηš„γƒ‡γ‚£γƒ¬γ‚―γƒˆγƒͺγ¨γ—γ¦γƒžγ‚¦γƒ³γƒˆ
8
+ app.mount("/file", StaticFiles(directory="file"), name="file")
9
+
10
+ # γƒ«γƒΌγƒˆγ«γ‚’γ‚―γ‚»γ‚Ήγ—γŸγ‚‰ /file/index.html を返す
11
+ @app.get("/")
12
+ def read_root():
13
+ return FileResponse("file/index.html")