Over a million developers have joined DZone.

Customization of Node-RED on Bluemix

Learn how Node-RED, a tool for wiring together hardware devices, can be utilized on Bluemix.

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

Bluemix provides starters to deploy Node-RED on Bluemix so that, for example, you can easily start creating flows for Internet of Things scenarios. In some cases however you might want to change the home page of your application, enforce authentication, add more nodes, change configuration files or set up your own default flows. Below is a short description how to do these types of customization.

On GitHub there is a project called Node-RED Bluemix Starter Application which is very similar to what you get when using the starters. This project can be forked or cloned and customized before deploying it to Bluemix. In order to make the deployment very simple it comes with a sample Bluemix Deploy button and a manifest.yml file.

Here is a simple customization example. In a sample I built recently I used Node-RED to host an API that is invoked by another web application. To document the API I wanted to use Swagger and the Node-RED Swagger Documentation Generator and I needed to use CORS for cross domain access.


In order to use CORS I added a few lines to the settings in bluemix-settings.js.

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

In order to add the Swagger node I had to declare another dependency in package.json. After this the Swagger documentation can be accessed via http://niknodered.mybluemix.net/http-api/swagger.json.

"dependencies": {

To learn more about Node-RED customization read the documentation and check out the new node-red-contrib-npm node from my colleague James Thomas to deploy new Node.js modules without having to redeploy Node-RED.

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

ibm bluemix

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}