pluto90 commited on
Commit
a332565
·
verified ·
1 Parent(s): 096c37b

Update api/main.py

Browse files
Files changed (1) hide show
  1. api/main.py +12 -1
api/main.py CHANGED
@@ -13,6 +13,10 @@ import re
13
  import shap
14
  import numpy as np
15
 
 
 
 
 
16
  sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
17
  os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
18
 
@@ -28,9 +32,16 @@ app = FastAPI(
28
  version="2.0.0"
29
  )
30
 
 
 
 
 
 
31
  app.add_middleware(
32
  CORSMiddleware,
33
- allow_origins=["http://localhost:5173"],
 
 
34
  allow_credentials=True,
35
  allow_methods=["*"],
36
  allow_headers=["*"],
 
13
  import shap
14
  import numpy as np
15
 
16
+ from pathlib import Path
17
+
18
+
19
+
20
  sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
21
  os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
22
 
 
32
  version="2.0.0"
33
  )
34
 
35
+ app = FastAPI(title="PlateVision Backend")
36
+
37
+
38
+ FRONTEND_URL = os.environ.get("FRONTEND_URL")
39
+
40
  app.add_middleware(
41
  CORSMiddleware,
42
+ allow_origins=[
43
+ FRONTEND_URL
44
+ ],
45
  allow_credentials=True,
46
  allow_methods=["*"],
47
  allow_headers=["*"],