controller.py 658 Bytes
Newer Older
1 2 3 4 5 6 7 8
"""The /misc controller provides an API for everything that does not belong
in any of the other categories."""

import logging
from typing import Tuple

from flask import Blueprint, jsonify, Response

Sascha Herzinger's avatar
Sascha Herzinger committed
9 10
from fractalis.cleanup import janitor

11 12 13 14 15 16 17

misc_blueprint = Blueprint('misc_blueprint', __name__)
logger = logging.getLogger(__name__)


@misc_blueprint.route('/version', methods=['GET'])
def get_version() -> Tuple[Response, int]:
18
    version = '0.6.0'
Sascha Herzinger's avatar
Sascha Herzinger committed
19 20 21
    # this is a good place to launch the janitor because /version is one of the
    # first requests sent by the front-end on initialization
    janitor.delay()
22
    return jsonify({'version': version}), 201