From a251f8a53282b63e050f4f9a39e3c60f0b822011 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Fri, 2 Jun 2017 22:37:39 +1000 Subject: [PATCH] Change debugging --- index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index dd76bed..c86cec7 100644 --- a/index.ts +++ b/index.ts @@ -8,16 +8,16 @@ import HashMap = require('hashmap'); import { IPGeoJson } from './ip_geo'; var app = express(); +app.enable('trust-proxy'); var cache = new HashMap(); app.engine('handlebars', expresshb({ defaultLayout: 'main' })); app.set('view engine', 'handlebars'); -app.enable('trust-proxy'); app.get('/', function (req, res) { - getIpInfo(req.ips[0]).done(function (geoinfo: IPGeoJson) { + getIpInfo(req.ip).done(function (geoinfo: IPGeoJson) { console.log("ip: " + geoinfo.ip); - console.log("ips[0]: " + req.ips[0]); + console.log("req.ip: " + req.ip); res.render('home', { helpers: { ip: function () { return geoinfo.ip; },