mirror of
https://github.com/italicsjenga/handlebars-ipinfo.git
synced 2024-11-23 21:11:31 +11:00
Change debugging
This commit is contained in:
parent
ac494ec0e3
commit
a251f8a532
6
index.ts
6
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; },
|
||||
|
|
Loading…
Reference in a new issue