"""
Core web application views.

:copyright: Copyright 2013-2016, Dorian Pula <dorian.pula@amber-penguin-software.ca>
:license: AGPL v3+
"""

import logging

import flask

import rookeries
from rookeries.main import rookeries_app

logger = logging.getLogger(__name__)


@rookeries_app.route('/status')
def app_status():
    """Simple view that returns the status of the application.  Useful as a part of a heartbeat mechanism."""
    app_status_info = {
        'app': 'rookeries',
        'version': rookeries.__version__,
    }

    return flask.jsonify(app_status_info)
