File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040# Call get_langs() when the server loads to load the languages into memory
4141LANGS = get_langs ()
4242
43- if not os .getenv ("PRODUCTION" , False ):
44- origins = ["http://localhost:4200" ] # Allow requests from Angular app
45- web_api_app .add_middleware (
46- CORSMiddleware ,
47- allow_origins = origins ,
48- allow_credentials = True ,
49- allow_methods = ["*" ],
50- allow_headers = ["*" ],
51- )
43+ if os .getenv ("PRODUCTION" , True ):
44+ origins = [
45+ "https://readalong-studio.mothertongues.org" ,
46+ ] # Allow requests from mt app
47+ else :
48+ origins = ["*" ] # Allow requests from any origin
49+ web_api_app .add_middleware (
50+ CORSMiddleware ,
51+ allow_origins = origins ,
52+ allow_credentials = True ,
53+ allow_methods = ["GET" , "POST" ],
54+ allow_headers = ["*" ],
55+ )
5256
5357
5458class RequestBase (BaseModel ):
You can’t perform that action at this time.
0 commit comments