diff --git a/app.py b/app.py index a1b5579..7df2740 100755 --- a/app.py +++ b/app.py @@ -52,8 +52,6 @@ def showMapFromLatLng(lat, lng): # API @get('/api/,') def latLngToHash(lat, lng): - print(lat, file=sys.stdout) - print(lng, file=sys.stdout) try: three = these.three_words((lat,lng,)) six = these.six_words((lat,lng,)) @@ -62,6 +60,24 @@ def latLngToHash(lat, lng): print(error, file=sys.stderr) return {} +@get('/api/three/,') +def latLngToThreeHash(lat, lng): + try: + three = these.three_words((lat,lng,)) + return {'three': three} + except Exception as error: + print(error, file=sys.stderr) + return {} + +@get('/api/six/,') +def latLngToSixHash(lat, lng): + try: + six = these.six_words((lat,lng,)) + return {'six': six} + except Exception as error: + print(error, file=sys.stderr) + return {} + @get('/api/') def hashToLatLng(threewords):