Add simple /status route

This commit is contained in:
Sage Vaillancourt 2022-10-02 22:52:14 -04:00
parent d777401475
commit d98deb9dec
1 changed files with 5 additions and 0 deletions

View File

@ -279,6 +279,11 @@ def git_update() -> None:
subprocess.Popen(['bash', '-c', "test -f " + script + " && " + script]) subprocess.Popen(['bash', '-c', "test -f " + script + " && " + script])
@writing_blueprint.route('/status', methods=['GET'])
def status_page() -> Response:
status_message = f'Currently running on {os.environ.get("UNDERCOVER_SERVER_NAME")} server'
return make_response(render_template('error.jinja2', status=200, error_text=status_message), 200)
@writing_blueprint.route('/', methods=['POST']) @writing_blueprint.route('/', methods=['POST'])
def generate_pdf() -> Response: def generate_pdf() -> Response:
email_address = session.get('username') email_address = session.get('username')