First shot at a web interface

This commit is contained in:
Thomas Kolb 2023-11-13 20:04:45 +01:00
parent 7f4c166bab
commit a93283d236
1 changed files with 14 additions and 0 deletions

14
web.py Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python3
from bottle import response, route, run, template
from io import StringIO
import qsomap
@route('/render/<lat>/<lon>')
def render(lat, lon):
svg_stream = StringIO()
qsomap.render(float(lat), float(lon), svg_stream, None)
response.content_type = 'image/svg+xml'
return svg_stream.getvalue()
run(host='localhost', port=8080)