-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.py
67 lines (50 loc) · 1.75 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from flask import Flask, json, render_template
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.after_request
def add_header(response):
"""
https://stackoverflow.com/questions/13768007/browser-caching-issues-in-flask
"""
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
response.headers['Cache-Control'] = 'public, max-age=0'
return response
@app.route('/')
def default():
return render_template('index.html')
@app.route('/mtlfs/about')
def about():
return 'Check out https://github.com/vta/Managed-and-Tolled-Lanes-Feed-Specification/ or the mtlfs.json page.'
@app.route('/mtlfs/mtlfs.json')
def mtlfs():
return app.send_static_file('mtlfs.json')
@app.route('/mtlfs/general_toll_info.json')
def general_toll_info():
return app.send_static_file('general_toll_info.json')
@app.route('/mtlfs/toll_authority_info.json')
def toll_authority_info():
return app.send_static_file('toll_authority_info.json')
@app.route('/mtlfs/toll_destination.json')
def toll_destination():
return app.send_static_file('toll_destination.json')
@app.route('/mtlfs/toll_facility.json')
def toll_facility():
return app.send_static_file('toll_facility.json')
@app.route('/mtlfs/toll_periods.json')
def toll_periods():
return app.send_static_file('toll_periods.json')
@app.route('/mtlfs/toll_status.json')
def toll_status():
return app.send_static_file('toll_status.json')
@app.route('/mtlfs/toll_signs_geom.json')
def toll_signs():
return app.send_static_file('toll_signs_geom.json')
@app.route('/mtlfs/gantry_geom.json')
def gant():
return app.send_static_file('gantry_geom.json')
@app.route('/mtlfs/facility_geom.json')
def facility_geom():
return app.send_static_file('facility_geom.json')
if __name__ == '__main__':
app.run(debug=True)