Simple web app
In case of that a cors problem using Node-RED as REST server can not be fixed. I wrote a simple sample WebApp to access REST forward server, which has cors enabled.
var cors = require("cors"); // Cors app.use(cors());
Related blog post: cors and Node-RED using a simple forwarding server
Note: Static sample web page uses as a starting point code from stackoverfollow.
git clone https://github.com/thomassuedbroecker/hackathons_and_node-red.git cd /hackathons_and_node-red/simple_web_app
npm start > @ start /hackathons_and_node-red/simple_web_app > node server.js Listening on port (3001)
Open http://localhost:3001 in the browser and insert some text in the edit box.
You should the you response like this:
- WebApp webpage output
- Forward server console output
- Node-RED output