|
| 1 | +# deploy openflow nodered using NPM |
| 2 | + |
| 3 | +#### Quick start running openflow nodered using npm on windows |
| 4 | + |
| 5 | +This require you to have openflow installed somewhere, or you can use our public openflow at [app.openiap.io](https://app.openiap.io) (noderedremote.env) |
| 6 | + |
| 7 | +Create a user for the nodered in openflow, you will need the username and password for this user in the last step |
| 8 | + |
| 9 | +[Install Chocolatey](https://chocolatey.org/install) |
| 10 | + |
| 11 | +open a command prompt as admin |
| 12 | + |
| 13 | +install nodejs LTS 14 |
| 14 | + |
| 15 | +``` |
| 16 | +choco install nodejs-lts |
| 17 | +``` |
| 18 | + |
| 19 | +install openflow-nodered command line |
| 20 | +`npm i @openiap/nodered -g` |
| 21 | + |
| 22 | +Go to the folder where you want to keep your config files, |
| 23 | + |
| 24 | +```bash |
| 25 | +mkdir c:\openflow |
| 26 | +cd \openflow |
| 27 | +``` |
| 28 | + |
| 29 | +install pm2 as a global package, and then install [pm2-windows-service](https://www.npmjs.com/package/pm2-windows-service) |
| 30 | +**Important**: Say no to startup scripts PM2_SERVICE_SCRIPTS |
| 31 | +```bash |
| 32 | +npm i -g pm2 |
| 33 | +npm i -g pm2-windows-service |
| 34 | +pm2-service-install |
| 35 | +# Perform environment setup: answer yes |
| 36 | +# Set PM2_HOME: answer yes and the type the path to the folder you intent on saving the openflow/nodered config files into ( like c:\openflow ) |
| 37 | +# PM2_SERVICE_SCRIPTS: answer no |
| 38 | +# PM2_SERVICE_PM2_DIR: answer yes, and then accept the default path |
| 39 | +``` |
| 40 | + |
| 41 | +then create a template configuration file using |
| 42 | +`openflow-nodered-cli --init` |
| 43 | + |
| 44 | +this will create 2 environment files with an example of how to connect to a locally installed openflow or how to connect to [app.openiap.io](https://app.openiap.io) |
| 45 | +So lets assume you want to run a remote openflow connected to [app.openiap.io](https://app.openiap.io) |
| 46 | + |
| 47 | +`openflow-nodered-cli --install noderedremote` |
| 48 | + |
| 49 | +this will prompt you for a pre-created username and password, and then install a local service with the name noderedremote and start it |
| 50 | + |
| 51 | +then open a browser and visit [localhost.openiap.io:1880](http://localhost.openiap.io:1880) |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +#### Quick start running openflow nodered using npm on linux |
| 56 | + |
| 57 | +For now only tested on ubuntu 18LTS |
| 58 | +Install NodeJS version 14 |
| 59 | +This require you to have openflow installed somewhere, or you can use our public openflow at [app.openiap.io](https://app.openiap.io) (noderedremote.env) |
| 60 | + |
| 61 | +Create a user for the nodered in openflow, you will need the username and password for this user in the last step |
| 62 | + |
| 63 | +Then install and run OpenFlow Nodered, install the @openiap/nodered package |
| 64 | +`sudo npm i @openiap/nodered -g` |
| 65 | + |
| 66 | +then create a template configuration file using |
| 67 | +`openflow-nodered-cli --init` |
| 68 | + |
| 69 | +this will create 2 environment files with an example of how to connect to a locally installed openflow or how to connect to [app.openiap.io](https://app.openiap.io) |
| 70 | +So lets assume you want to run a remote openflow connected to [app.openiap.io](https://app.openiap.io) |
| 71 | + |
| 72 | +`sudo openflow-nodered-cli --install noderedremote` |
| 73 | + |
| 74 | +this will prompt for the pre-created username and password, and then install a local service with the name noderedremote and start it |
| 75 | + |
| 76 | +then open a browser and visit [localhost.openiap.io:1880](http://localhost.openiap.io:1880) |
| 77 | + |
| 78 | +I also go though this process in the video |
| 79 | +[](https://youtu.be/XgeD7Bv2duY) |
0 commit comments