Ken Sang Tang commited on
Commit
22d8b35
·
verified ·
1 Parent(s): 7d0a6f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -1,7 +1,12 @@
1
- from fastapi import FastAPI
2
 
3
- app = FastAPI()
 
 
 
 
 
 
4
 
5
- @app.get("/")
6
- def greet_json():
7
- return {"Hello": "World!"}
 
1
+ import toml
2
 
3
+ # Load OPENMANUS_ENDPOINT_URL from env or config fallback
4
+ OPENMANUS_ENDPOINT_URL = os.getenv("OPENMANUS_ENDPOINT_URL")
5
+ if not OPENMANUS_ENDPOINT_URL:
6
+ config_path = "config/config.toml"
7
+ if os.path.exists(config_path):
8
+ config = toml.load(config_path)
9
+ OPENMANUS_ENDPOINT_URL = config.get("OPENMANUS_ENDPOINT_URL")
10
 
11
+ if not OPENMANUS_ENDPOINT_URL:
12
+ raise EnvironmentError("OPENMANUS_ENDPOINT_URL must be set in env or config/config.toml")