Arts-of-coding commited on
Commit
1f94bf5
1 Parent(s): 33821ef

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -1
main.py CHANGED
@@ -68,7 +68,13 @@ app = FastAPI()
68
  async def root():
69
  return {"message": "Hello World"}
70
 
 
 
 
 
 
 
 
71
  # Start the FastAPI server
72
  if __name__ == "__main__":
73
- app.mount("/dashboard1", WSGIMiddleware(dashboard1.server))
74
  uvicorn.run(app, host="0.0.0.0", port=5000)
 
68
  async def root():
69
  return {"message": "Hello World"}
70
 
71
+ app.mount("/dashboard1", WSGIMiddleware(dashboard1.server))
72
+ # Added the following lines to demonstrate the usage of the /dashboard1 endpoint
73
+ @app.get("/dashboard1")
74
+ def serve_dashboard1():
75
+ # Return an index.html file as response content
76
+ return HTMLResponse(open('static/index.html', 'r').read())
77
+
78
  # Start the FastAPI server
79
  if __name__ == "__main__":
 
80
  uvicorn.run(app, host="0.0.0.0", port=5000)