Hello everyone,
I'm using the following code from Embedding into an existing app https://nodered.org/docs/user-guide/runtime/embedding and everything works fine but the version of node-red is not the latest.
I've already updated node-red and when I'm running node-red
from console I get the version [info] Node-RED version: v1.0.2
I get this version [info] Node-RED version: v0.20.8
, when I'm running the following code.
var http = require('http');
var express = require("express");
var RED = require("node-red");
// Create an Express app
var app = express();
// Add a simple route for static content served from 'public'
app.use("/",express.static("public"));
// Create a server
var server = http.createServer(app);
// Create the settings object - see default settings.js file for other options
var settings = {
httpAdminRoot:"/red",
httpNodeRoot: "/api",
functionGlobalContext: { } // enables global context
};
// Initialise the runtime with a server and settings
RED.init(server,settings);
// Serve the editor UI from /red
app.use(settings.httpAdminRoot,RED.httpAdmin);
// Serve the http nodes UI from /api
app.use(settings.httpNodeRoot,RED.httpNode);
server.listen(8000);
// Start the runtime
RED.start();
How can I use the latest version here?