wai572 commited on
Commit
1196507
·
1 Parent(s): 1965e34
Files changed (1) hide show
  1. main.py +7 -0
main.py CHANGED
@@ -38,6 +38,13 @@ origins = [
38
  "http://localhost:5173", # Default URL for Vite React dev server
39
  "https://board-recognizer-30ib6veo9-wai572s-projects.vercel.app", # Your deployed frontend
40
  ]
 
 
 
 
 
 
 
41
 
42
  # AIモデルとテンプレートを起動時に読み込む
43
  trocr_pipeline = None # load_model()のロジックをここに
 
38
  "http://localhost:5173", # Default URL for Vite React dev server
39
  "https://board-recognizer-30ib6veo9-wai572s-projects.vercel.app", # Your deployed frontend
40
  ]
41
+ app.add_middleware(
42
+ CORSMiddleware,
43
+ allow_origins=origins, # Specifies the allowed origins
44
+ allow_credentials=True, # Allows cookies to be included in requests
45
+ allow_methods=["*"], # Allows all methods (GET, POST, etc.)
46
+ allow_headers=["*"], # Allows all headers
47
+ )
48
 
49
  # AIモデルとテンプレートを起動時に読み込む
50
  trocr_pipeline = None # load_model()のロジックをここに