From 8a8643540820efb0d8e505fb460db329f5d2b8f2 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Fri, 2 Jun 2017 22:32:40 +1000 Subject: [PATCH] Add debugging --- index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.ts b/index.ts index 9f29cd3..67c94c4 100644 --- a/index.ts +++ b/index.ts @@ -16,6 +16,7 @@ app.enable('trust-proxy'); app.get('/', function (req, res) { getIpInfo(req.ip).done(function (geoinfo: IPGeoJson) { + console.log("ip: " + geoinfo.ip); res.render('home', { helpers: { ip: function () { return geoinfo.ip; }, @@ -59,8 +60,10 @@ function getIpInfo(ip: String): Promise.IThenable<{}> { var cached = cache.get(ip); if (cached != null) { + console.log("serving cached"); resolve(cached); } else { + console.log("serving fetched"); https.get(options, callback); } })