Configure Front End Testing Environment; Resolve CORS
Additional walkthrough for setting up a front end testing environment; because REST services will be running either locally (on a different port from the front end) or from a dev stack, you will need to configure your local environment to support CORS requests.
Step-by-step guide
For Chrome:
- Run chrome from the terminal with: "google-chrome --disable-web-security"
For FireFox:
- Add "Cors Everywhere" to firefox. This plugin will insert CORS headers on all requests. Note that this poses a security risk and should only be enabled when using the browser for testing DMC front end.
- In firefox, go to navigate to about:addons and click on "extensions" on the left:
- Search for "cors everywhere" and install
- Configure Cors Everywhere
- Cors Everywhere can be toggled on and off and functions browser-wide.
- Add the toggle button to the firebfox menu by opening the menu and clicking customize:
- Then drag CorsE's ugly logo in to the right menu, then click exit customize.
- You can now toggle CorsE on (green) and off (pink/red) by opening the hamburger menu in firefox.
Verify
If done correctly, when enabled, you'll get 200 responses from REST endpoints and see the CORS headers (Access-Control...) in the response: