|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
|
|
|
-
|
|
|
+ console.log(process.env);
|
|
|
|
|
|
var http = require('http');
|
|
|
var httpProxy = require('http-proxy');
|
|
@@ -8,8 +8,7 @@ var proxy = httpProxy.createProxyServer({
|
|
|
|
|
|
});
|
|
|
proxy.on("error", function(err, req, res, urla){
|
|
|
-
|
|
|
-
|
|
|
+ console.log("ERROR",err);
|
|
|
res.write(JSON.stringify(err,true,2));
|
|
|
res.end();
|
|
|
})
|
|
@@ -18,7 +17,7 @@ http.createServer(function(req, res) {
|
|
|
|
|
|
|
|
|
req.url = '/wp-json/metrics';
|
|
|
- proxy.web(req, res, { target: 'http://192.168.1.61:9118' });
|
|
|
+ proxy.web(req, res, { target: process.env.WP_METRICS_URL || 'http://localhost:8080' });
|
|
|
|
|
|
|
|
|
}).listen(9117);
|