Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a proxy.conf.json file inside src and add the following content,

    Code Block
    {
      "/api/*": {
        "target": "https://aws.digitalid.lgcc.gov.lk/<base_URL>",
        "secure": false,
        "logLevel": "debug"
      }
    }
  2. Go to angular.json and travers through, “projects -> pre-registration -> architect -> serve -> options” and then add "proxyConfig": "src/proxy.conf.json" beside browsertarget.

  3. Go to config.json and environment.ts and change the base URL to your base URL.

  4. Now do a ng serve and you would not face the issue.

Info

If you still face the issue enable CORS plugin in the browser level and that should let you send and receive different origin requests. You could use the following plugins for Chrome and Firefox,

MOSIP thanks Michael Marshal from Axiata Digital Labs, Sri Lanka for contributing the contents that constitute this page.

...