"""
Main package for Rookeries.

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

import logging

from rookeries import config, main, logging_config, app

__author__ = 'Dorian Pula'
__version__ = '0.5.0'


logging_config.configure_logging()
logger = logging.getLogger(__name__)


def make_rookeries_app():
    """Creates and setups a Rookeries webapp."""
    logger.info("*** Rookeries API Server - version %s ***", __version__)
    logger.info("Starting Rookeries API server...")
    web_app = app.make_json_app(__name__)
    web_app.register_blueprint(main.rookeries_app)
    config.configure_web_app(web_app)
    logger.info("Rookeries API started!")
    return web_app
