Created
December 9, 2015 07:59
-
-
Save joeartsea/65c6aedeb164bfc306ee to your computer and use it in GitHub Desktop.
Node-REDの画面カスタマイズ方法 ref: http://qiita.com/joeartsea/items/6400e21eefa5a9b44e15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var express = require("express"); | |
var settings = require("./settings"); // <- require | |
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); | |
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="style.css" /> | |
<p class="test">Node-REDを組込んだExpressアプリケーション</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
httpAdminRoot:"/red", | |
httpNodeRoot: "/api", | |
functionGlobalContext: { } // enables global context | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.test { color: red; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment