Add support for city lookup

This commit is contained in:
Martin Polden
2016-04-17 11:28:47 +02:00
parent 8027c55fdf
commit 8f71576357
7 changed files with 77 additions and 11 deletions

View File

@ -66,6 +66,13 @@ $ fetch -qo- http://ifconfig.co
$ http ifconfig.co/country
{{ .Country }}
</pre>
{{ end }}
{{ if .IsLookupCityEnabled }}
<p>City lookup:</p>
<pre>
$ http ifconfig.co/city
{{ .City }}
</pre>
{{ end }}
</div>
<div class="pure-u-1 pure-u-md-1-2">
@ -78,7 +85,8 @@ Content-Type: application/json
Date: Fri, 15 Apr 2016 17:26:53 GMT
{ {{ if .IsLookupCountryEnabled }}
"country": "{{ .Country }}",{{ end }}{{ if .IsLookupAddrEnabled }}
"country": "{{ .Country }}",{{ end }}{{ if .IsLookupCityEnabled }}
"city": "{{ .City }}",{{ end }}{{ if .IsLookupAddrEnabled }}
"hostname": "{{ .Hostname }}",{{ end }}
"ip": "{{ .IP }}"
}