diff --git a/server.py b/server.py new file mode 100755 index 0000000..97a7e62 --- /dev/null +++ b/server.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +from bottle import ( + get, + run, + template +) + +import thesethreewords as these + + +@get('/') +def index(): + return template('index', err=None) + +@get('/') +def showMap(threewords): + try: + lat, lng = these.decode(threewords) + return template('map', lat=lat, lng=lng) + except: + return template('index', + err="Could not find location {}".format(threewords)) + + +if __name__ == '__main__': + run(host='localhost', port=8080) diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..1a90a62 --- /dev/null +++ b/views/index.html @@ -0,0 +1,47 @@ + + + + + + + these-3-words Map + + + + +
+ % if err: + + % end +
+

These3Words Map

+

+ Find a location anywhere in the word identified by three simple words. +

+

+ +

+

+ +

+
+ +
+ + diff --git a/views/map.html b/views/map.html new file mode 100644 index 0000000..345846d --- /dev/null +++ b/views/map.html @@ -0,0 +1,24 @@ + + + + + + + + +
+ +