add compression middleware to worldmap
This commit is contained in:
parent
83c726966a
commit
ac57a17062
@ -4,6 +4,7 @@
|
|||||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cgi": "0.3.1",
|
"cgi": "0.3.1",
|
||||||
|
"compression": "^1.7.4",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"sockjs": "^0.3.19"
|
"sockjs": "^0.3.19"
|
||||||
},
|
},
|
||||||
|
@ -18,6 +18,7 @@ module.exports = function(RED) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var express = require("express");
|
var express = require("express");
|
||||||
|
var compression = require("compression");
|
||||||
var sockjs = require('sockjs');
|
var sockjs = require('sockjs');
|
||||||
var sockets = {};
|
var sockets = {};
|
||||||
RED.log.info("Worldmap version " + require('./package.json').version );
|
RED.log.info("Worldmap version " + require('./package.json').version );
|
||||||
@ -53,6 +54,7 @@ module.exports = function(RED) {
|
|||||||
this.log("started at "+this.path);
|
this.log("started at "+this.path);
|
||||||
var node = this;
|
var node = this;
|
||||||
var clients = {};
|
var clients = {};
|
||||||
|
RED.httpNode.use(compression());
|
||||||
RED.httpNode.use(node.path, express.static(__dirname + '/worldmap'));
|
RED.httpNode.use(node.path, express.static(__dirname + '/worldmap'));
|
||||||
|
|
||||||
var callback = function(client) {
|
var callback = function(client) {
|
||||||
|
Loading…
Reference in New Issue
Block a user