christopher commited on
Commit
0907a69
·
1 Parent(s): e9eae31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,8 +1,12 @@
1
  from fastapi import FastAPI
2
  from fastapi.responses import HTMLResponse
 
3
 
4
  app = FastAPI()
5
 
 
 
 
6
  @app.get("/", response_class=HTMLResponse)
7
  def read_root():
8
  return """
@@ -22,4 +26,4 @@ def read_root():
22
  </script>
23
  </body>
24
  </html>
25
- """
 
1
  from fastapi import FastAPI
2
  from fastapi.responses import HTMLResponse
3
+ from fastapi.staticfiles import StaticFiles
4
 
5
  app = FastAPI()
6
 
7
+ # Mount static files - THIS IS REQUIRED
8
+ app.mount("/static", StaticFiles(directory="static"), name="static")
9
+
10
  @app.get("/", response_class=HTMLResponse)
11
  def read_root():
12
  return """
 
26
  </script>
27
  </body>
28
  </html>
29
+ """