I'm currently using the HTTP-in node which is set to accept a POST request which is working fine. However I am then trying to use the HTTP-response node to send back data.
The problem I'm facing is that even though I have added Access-Control-Allow-Origin: * header to the response my browser is still stating that "CORS header ‘Access-Control-Allow-Origin’ missing".
What am I missing?
Node-red flow:
[{"id":"4f207f6e0c1f8f73","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"0c75203ff1c6e073","type":"http in","z":"4f207f6e0c1f8f73","name":"/sentiment POST","url":"/sentiment","method":"post","upload":false,"swaggerDoc":"","x":180,"y":260,"wires":[["ed969497ee72ebbe"]]},{"id":"ed969497ee72ebbe","type":"sentiment","z":"4f207f6e0c1f8f73","name":"sentiment analysis","property":"payload.body","x":393,"y":117,"wires":[["c1fefb75bbc7d877"]],"l":false},{"id":"c1fefb75bbc7d877","type":"function","z":"4f207f6e0c1f8f73","name":"","func":"msg.payload = {\n email : msg.payload.email,\n sentiment : msg.sentiment.score\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":514,"y":238,"wires":[["dabe0ecc0e05408c"]],"l":false},{"id":"dabe0ecc0e05408c","type":"http response","z":"4f207f6e0c1f8f73","name":"","statusCode":"","headers":{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST"},"x":684,"y":323,"wires":[],"l":false}]