-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmap.py
More file actions
23 lines (19 loc) · 679 Bytes
/
Copy pathmap.py
File metadata and controls
23 lines (19 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
import os
from flask import Flask, render_template, request, redirect, url_for, jsonify
import json
app = Flask(__name__)
with open('updated_data.json') as f:
states = json.load(f)
average_icu = [(x, states[x]['avg_icu'], states[x]['distributed'], states[x]['administered']) for x in states]
@app.route('/')
def home():
"""Render website's home page."""
return jsonify(average_icu)
if __name__ == '__main__':
app.run(debug=True)