-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.py
38 lines (31 loc) · 931 Bytes
/
server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from bottle import get, post, redirect, run, request, response, static_file, jinja2_view
import functools
view = functools.partial(jinja2_view)
@get('/slides/')
@view('slides.html')
def slides():
slides = [{
'label': 'original',
'slide1': '/tiles/original.dzi',
'slide2': '/tiles/heatmap.dzi',
'thumb': '/tiles/original.thumb.jpg'
},{
'label': 'streets',
'slide1': '/tiles/streets.dzi',
'slide2': '/tiles/oval.dzi',
'thumb': '/tiles/streets.thumb.png'
}, {
'label': 'globe',
'slide1': '/tiles/globe.dzi',
'slide2': '/tiles/oval.dzi',
'thumb': '/tiles/globe.thumb.jpg'
}]
return {'slides': slides}
# Static
@get('/lib/<filepath:path>')
def static_lib(filepath):
return static_file(filepath, root='lib')
@get('/tiles/<filepath:path>')
def static_tiles(filepath):
return static_file(filepath, root='tiles')
run(host='0.0.0.0', port=8000, debug=True, reloader=True)