From d8ffebe181adcaf462412399304797a3fadfff11 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Fri, 6 Sep 2019 22:00:16 +0100 Subject: [PATCH] added current flat ip --- server.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/server.js b/server.js index e24b191..4cf1c0c 100644 --- a/server.js +++ b/server.js @@ -218,7 +218,6 @@ function getUrl (req, res) { }); } - function getUrlV2(req, res) { let final; const firstUrl = req.params.encoded_id; @@ -245,25 +244,17 @@ function getUrlV2(req, res) { // console.log('Options', options); logger.info(`V2 >> getting ${theUrl}`); - request({ - url : theUrl, - proxy : 'http://us-wa.proxymesh.com:31280', - tunnel : true + 'url' : theUrl, + 'proxy' : 'http://uk.proxymesh.com:31280', + 'tunnel' : true }, (err, _res, body) => { - - if (!err) { + if (!err) res.send(body); - } else { + else res.send(''); - } - - - }); - - } app.get('/:encoded_id', cache('15 minutes'), getUrlV2);