Documentation

CORS with Loopback & Angular Apps

To get the two running nicely together in respect to CORS, don’t forget to disable the origin only default policy of Loopback by setting the origin in the CORS configuration to “*” in the middleware.json file.

{
  ...
  "initial": {
    "compression": {},
    "cors": {
      "params": {
        "origin": "*",
        "credentials": true,
        "maxAge": 86400
      }
    }
    ...
  }
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s