arsh1101 commited on
Commit
e02a7b9
·
verified ·
1 Parent(s): d7bdc98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -11,17 +11,21 @@ from fastapi.middleware.cors import CORSMiddleware
11
  import os
12
 
13
  # 1) Force config directory and env var before any SHConfig is touched
14
- CONFIG_DIR = "/app/.config/sentinelhub"
15
- CONFIG_FILE = os.path.join(CONFIG_DIR, "config.json")
16
- os.makedirs(CONFIG_DIR, exist_ok=True)
17
- os.environ["SH_CONFIG_HOME"] = CONFIG_DIR
18
 
19
  # 2) Now import and instantiate SHConfig
20
  from sentinelhub import SHConfig
21
 
22
  # If you want to point directly to a file:
23
  # config = SHConfig(config_location=CONFIG_FILE)
24
- config = SHConfig()
 
 
 
 
25
 
26
  app = FastAPI()
27
 
 
11
  import os
12
 
13
  # 1) Force config directory and env var before any SHConfig is touched
14
+ # CONFIG_DIR = "/app/.config/sentinelhub"
15
+ # CONFIG_FILE = os.path.join(CONFIG_DIR, "config.json")
16
+ # os.makedirs(CONFIG_DIR, exist_ok=True)
17
+ # os.environ["SH_CONFIG_HOME"] = CONFIG_DIR
18
 
19
  # 2) Now import and instantiate SHConfig
20
  from sentinelhub import SHConfig
21
 
22
  # If you want to point directly to a file:
23
  # config = SHConfig(config_location=CONFIG_FILE)
24
+ config = SHConfig(
25
+ use_defaults=True,
26
+ sh_client_id=os.getenv("SH_CLIENT_ID"),
27
+ sh_client_secret=os.getenv("SH_CLIENT_SECRET")
28
+ )
29
 
30
  app = FastAPI()
31