diff --git a/spaceapi/views.py b/spaceapi/views.py --- a/spaceapi/views.py +++ b/spaceapi/views.py @@ -1,4 +1,4 @@ -from flask import Blueprint, jsonify, render_template +from flask import Blueprint, jsonify, render_template, abort from .auth import httpauth from .active import active_json, reload_json @@ -6,18 +6,21 @@ from .utils import request_wants_json root_views = Blueprint('root', __name__) + @root_views.route('/') def index(): if request_wants_json(): return jsonify(active_json) return render_template('index.html', status=active_json) + @root_views.route('/status.json') def status_json(): return jsonify(active_json) + @root_views.route('/reload') @httpauth.login_required def reload(): reload_json() - return 200 + return abort(200)