From 65d9d8ccf1a4ce4b03b6cbbe8d5e4f640e91e7b4 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sun, 17 Apr 2016 11:33:59 +0200 Subject: [PATCH] Cleanup examples --- index.html | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index 80005eb..c5dfef3 100644 --- a/index.html +++ b/index.html @@ -58,32 +58,24 @@ $ wget -qO- ifconfig.co {{ .IP }} $ fetch -qo- http://ifconfig.co -{{ .IP }} - +{{ .IP }} {{ if .IsLookupCountryEnabled }}

Country lookup:

 $ http ifconfig.co/country
-{{ .Country }}
-        
+{{ .Country }} {{ end }} {{ if .IsLookupCityEnabled }}

City lookup:

 $ http ifconfig.co/city
-{{ .City }}
-        
+{{ .City }} {{ end }}

JSON output:

 $ http ifconfig.co/json
-HTTP/1.1 200 OK
-Content-Length: 61
-Content-Type: application/json
-Date: Fri, 15 Apr 2016 17:26:53 GMT
-
 { {{ if .IsLookupCountryEnabled }}
     "country": "{{ .Country }}",{{ end }}{{ if .IsLookupCityEnabled }}
     "city": "{{ .City }}",{{ end }}{{ if .IsLookupAddrEnabled }}
@@ -91,24 +83,18 @@ Date: Fri, 15 Apr 2016 17:26:53 GMT
     "ip": "{{ .IP }}"
 }
 
-# or set Accept header to application/json:
-# http --json ifconfig.co
-        
-{{ if .IsLookupPortEnabled }} -

Testing port connectivity (only supports JSON output):

-
-http --json localhost:8080/port/8080
-HTTP/1.1 200 OK
-Content-Length: 47
-Content-Type: application/json
-Date: Fri, 15 Apr 2016 18:47:20 GMT
+# or set Accept header:
+# http ifconfig.co Accept:application/json
+{{ if .IsLookupPortEnabled }} +

Testing port connectivity:

+
+$ http ifconfig.co/port/8080
 {
-    "ip": "127.0.0.1",
+    "ip": "{{ .IP }}",
     "port": 8080,
-    "reachable": true
-}
-        
+ "reachable": false +} {{ end }}