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:

  1. Run chrome from the terminal with: "google-chrome --disable-web-security"

For FireFox:

  1. 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.
    1. In firefox, go to navigate to about:addons and click on "extensions" on the left:
    2. Search for "cors everywhere" and install
  2. Configure Cors Everywhere
    1. Cors Everywhere can be toggled on and off and functions browser-wide.
    2. Add the toggle button to the firebfox menu by opening the menu and clicking customize:
    3. Then drag CorsE's ugly logo in to the right menu, then click exit customize.
    4. 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: