-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
37 lines (31 loc) · 896 Bytes
/
app.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
import cross_reference as cr
import json
import flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello world!'
@app.route('/<eventID>')
def data(eventID):
data = json.dumps(cr.get_attack_weather(eventID))
res = flask.Response(data)
res.headers['Content-Type'] = 'application/json'
return res
@app.route('/temp/<event>')
def temp(event):
data = json.dumps(cr.get_attack_temp(cr.get_attack_weather(event)))
res = flask.Response(data)
res.headers['Content-Type'] = 'application/json'
return res
@app.route('/summary/<event>')
def summary(event):
data = json.dumps(cr.get_summary(event, True, False))
res = flask.Response(data)
res.headers['Content-Type'] = 'application/json'
return res
@app.route('/app')
def index():
return flask.send_file('index.html')
if __name__ == '__main__':
app.run()