-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
54 lines (47 loc) · 1.13 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const http = require('http');
const express = require("express");
const RED = require("node-red");
var app = express();
app.use("/", express.static("public"));
var server = http.createServer(app);
var settings = {
httpAdminRoot: "/",
httpNodeRoot: "/",
userDir: ".",
flowFile: "flows.json",
credentialSecret: false,
editorTheme: {
projects: {
enabled: false,
},
codeEditor: {
lib: "monaco",
options: {
theme: "vs"
}
}
},
};
RED.init(server, settings);
app.use(settings.httpAdminRoot, RED.httpAdmin);
app.use(settings.httpNodeRoot, RED.httpNode);
server.listen(8000);
RED.start();
/** const https = require('https');
const options = 'https://nodered.zeldalegends.repl.co';
//const options = {hostname: 'nodered.zeldalegends.repl.co', port: 80, path: '/test', headers: {'User-Agent': 'Mozilla/5.0'}};
setInterval(() => {
https.request(options, res => {
res.on('data', d => {
//process.stdout.write(d);
console.log(` (statusCode: ${res.statusCode})`);
})
})
.on('error', error => {
console.error(error)
})
.end();
}, 60000);
//console.log(process.version);
//console.log(Object.values(require('os')));
*/