-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarbosem.py
39 lines (29 loc) · 914 Bytes
/
carbosem.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
39
import os
import json
from bottle import route, template, redirect, run, error, request, response, static_file
@route('/')
def get_index():
return template('index')
@route('/static/css/<filename>')
def css(filename):
return static_file(filename, root='static/css')
@route('/static/image/<filename>')
def image(filename):
return static_file(filename, root='static/image')
@route('/static/js/<filename>')
def js(filename):
return static_file(filename, root='static/js')
@route('/static/json/<filename>')
def json(filename):
return static_file(filename, root='static/json')
@route('/getJSON')
def getJSON():
return static_file('data.json', root='static/json')
@route('/graph')
def graph():
# TODO
return True
if os.environ.get('APP_LOCATION') == 'heroku':
run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
else:
run(host='localhost', port=8080, debug=True)