diff --git a/app.py b/app.py index 46781a5..49ce9a0 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,8 @@ import requests import cachetools -from flask import Flask, request, jsonify, render_template, make_response +from flask import ( + Flask, request, make_response, jsonify, render_template) REPOS = cachetools.LRUCache(maxsize=128) RATES = cachetools.LRUCache(maxsize=96) @@ -109,7 +110,10 @@ def index(): @app.route('/report') def report(): - return jsonify(_make_report_data(iso=True)) + data = _make_report_data(iso=True) + resp = make_response(jsonify(data)) + resp.headers['Access-Control-Allow-Origin'] = "*" + return resp @app.route('/payload', methods=['POST']) diff --git a/run_locally.sh b/run_locally.sh index 18b125a..8fc4d8c 100755 --- a/run_locally.sh +++ b/run_locally.sh @@ -1,4 +1,4 @@ #!/bin/bash export FLASK_APP=app.py -python -m flask run --port=4632 +python -m flask run