cryogenic22 commited on
Commit
59b8e1a
·
verified ·
1 Parent(s): 85d909d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -1,22 +1,16 @@
1
  from fastapi import FastAPI
2
  from fastapi.staticfiles import StaticFiles
3
  import uvicorn
4
- import os
5
 
6
- # Initialize FastAPI app
7
  app = FastAPI()
8
 
9
- # Mount React build directory
10
- app.mount("/", StaticFiles(directory="frontend/build", html=True), name="static")
 
 
11
 
12
- def main():
13
- # Check if running in development or production
14
- if os.environ.get("ENVIRONMENT") == "development":
15
- # Start React development server
16
- os.system("cd frontend && npm start &")
17
-
18
- # Start FastAPI server
19
- uvicorn.run(app, host="0.0.0.0", port=7860)
20
 
21
  if __name__ == "__main__":
22
- main()
 
1
  from fastapi import FastAPI
2
  from fastapi.staticfiles import StaticFiles
3
  import uvicorn
 
4
 
 
5
  app = FastAPI()
6
 
7
+ # Add your API routes here
8
+ @app.get("/api/health")
9
+ def health_check():
10
+ return {"status": "ok"}
11
 
12
+ # Mount frontend files - we'll set this up after building
13
+ app.mount("/", StaticFiles(directory="frontend/build", html=True), name="static")
 
 
 
 
 
 
14
 
15
  if __name__ == "__main__":
16
+ uvicorn.run(app, host="0.0.0.0", port=7860)