diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-08-07 18:33:30 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-08-07 18:33:30 -0700 |
| commit | 236fd1d9f2009083fbbfce7190c27fbf1d7c88b8 (patch) | |
| tree | 6077ff15b4b770b4b292aaa14d9cbfff1ba82fae /pbserver.py | |
| parent | c89619f1b1f908d0f330c468866cea669ce8bf6c (diff) | |
getting ready
Diffstat (limited to 'pbserver.py')
| -rwxr-xr-x | pbserver.py | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/pbserver.py b/pbserver.py index 36a53a1..33415d6 100755 --- a/pbserver.py +++ b/pbserver.py @@ -1,5 +1,5 @@ #!/usr/bin/python2.7 -from bottle import route, run, post, request +from bottle import route, run, post, request, static_file from pb.gradient import Gradient from pb.imgrid import Imgrid @@ -172,4 +172,41 @@ def pattern(): raise; return json.dumps({ 'error' : 'Request could not be processed' }) -run(host='0.0.0.0', server='flup', port=8999, debug=True) +#static routes +@route('/im/<filename>') +def server_static(filename): + return static_file(filename, root='frontend/im/') +@route('/im') +def server_static(): + return static_file("index.html", root='frontend/im/') +@route('/imgrid') +def server_static(): + return static_file("index.html", root='frontend/imgrid/') +@route('/imgradient') +def server_static(): + return static_file("index.html", root='frontend/imgradient/') +@route('/imlandscape') +def server_static(): + return static_file("index.html", root='frontend/imlandscape/') +@route('/impattern') +def server_static(): + return static_file("index.html", root='frontend/impattern/') +@route('/imbreak') +def server_static(): + return static_file("index.html", root='frontend/imbreak/') +@route('/') +def server_static(): + return static_file("index.html", root='frontend/im/') +@route('/css/<filename>') +def server_static(filename): + return static_file(filename, root='frontend/css/') +@route('/js/<filename>') +def server_static(filename): + return static_file(filename, root='frontend/js/') +@route('/img/<filename>') +def server_static(filename): + return static_file(filename, root='frontend/img/') + + +#run(host='0.0.0.0', server='flup', port=8999, debug=True) +run(host='0.0.0.0', port=8999, debug=True) |
