mirror of
https://github.com/italicsjenga/handlebars-ipinfo.git
synced 2024-11-24 05:21:29 +11:00
Change to req.ip
This commit is contained in:
parent
8b9691faca
commit
c8d88b2f5b
3
index.ts
3
index.ts
|
@ -12,9 +12,10 @@ 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("::ffff:" + "119.17.156.106").done(function (geoinfo: IPGeoJson) {
|
||||
getIpInfo(req.ip).done(function (geoinfo: IPGeoJson) {
|
||||
res.render('home', {
|
||||
helpers: {
|
||||
ip: function () { return geoinfo.ip; },
|
||||
|
|
Loading…
Reference in a new issue