Closed saifulkhan closed 2 years ago
Happy to submit a PR for that to unblock us
It will be great :)
Done in #27
Looks like the issue is still there.
Test cases:
infrastructure-api (Javascript): Open and see if the list of dashboards are loaded https://deploy-preview-119--rampvis-ui-development.netlify.app/dashboard
data-api (Python): Open and see if the data is being served https://deploy-preview-119--rampvis-ui-development.netlify.app//stat/v1/data/?product=phe&component=newPeopleVaccinatedThirdInjectionByPublishDate&format=long
The CORS check in the Python API happens in: https://github.com/ScottishCovidResponse/rampvis-api/blob/main/data-api/app/main.py#L19 We need to review this part of the code too.
@saifulkhan what is the value of our env var? Do we have *--rampvis-ui-development.netlify.app
in the list of origins?
I did not know about the python routes, not sure what to suggest there!
Yes, I shared the config (it's a private repo) folder with you. https://github.com/saifulkhan/rampvis-config/blob/main/production.json
Right. Looks like we’ll need to enable allow_origin_regex
in python change the config to some regex 🤔
https://fastapi.tiangolo.com/tutorial/cors/
JS implementation would need to change too for parity.
Let me give it a try now
Yes, I wonder what should be the value of allow_origin_regex, "*--rampvis-ui-development.netlify.app"?
For example test: https://deploy-preview-119--rampvis-ui-development.netlify.app/page?id=6181746e3f35852412f6b3b4