Testys commited on
Commit
be1196b
·
verified ·
1 Parent(s): bb96c55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -2,6 +2,8 @@ import firebase_admin
2
  from firebase_admin import credentials, db
3
  from fastapi import FastAPI
4
  from fastapi.middleware.cors import CORSMiddleware
 
 
5
 
6
  # Path to your Firebase service account key file
7
  cred = credentials.Certificate("animvitals-firebase-adminsdk-sgfas-3c8e7f596c.json")
@@ -22,6 +24,9 @@ app.add_middleware(
22
  allow_headers=["*"], # Allow all headers
23
  )
24
 
 
 
 
25
  @app.get("/latest-data")
26
  async def get_latest_data():
27
  # Reference to the 'animal_data' node
 
2
  from firebase_admin import credentials, db
3
  from fastapi import FastAPI
4
  from fastapi.middleware.cors import CORSMiddleware
5
+ from fastapi.staticfiles import StaticFiles
6
+
7
 
8
  # Path to your Firebase service account key file
9
  cred = credentials.Certificate("animvitals-firebase-adminsdk-sgfas-3c8e7f596c.json")
 
24
  allow_headers=["*"], # Allow all headers
25
  )
26
 
27
+ app.mount("/", StaticFiles(directory="index.html", html=True), name="static")
28
+
29
+
30
  @app.get("/latest-data")
31
  async def get_latest_data():
32
  # Reference to the 'animal_data' node