Enable CORS with Node Red

In order to link to Node Red from other web servers, you’ll need to enable CORS, here is how to do that:

Edit /var/node-red/settings.js (assuming you’ve moved it here as described, otherwise you’ll need to “find / -name settings.js” to find the file.

Search the file and uncomment the following:

httpNodeCors: {
origin: "*",
methods: "GET,PUT,POST,DELETE"
},

Next, restart NodeRed, if it’s a service “systemctl restart nodered”.

One thought on “Enable CORS with Node Red

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