Source code for luna_licenses.app.handlers.version_handler

# -*- coding: utf-8 -*-
"""Version Handler

Module realize version handler.
"""
from sanic.response import HTTPResponse

from app.handlers.base_handler import BaseLicensesRequestHandler
from app.version import VERSION
from crutches_on_wheels.cow.utils.timer import timer


[docs]class VersionHandler(BaseLicensesRequestHandler): """ Handler for getting version """
[docs] @timer async def get(self) -> HTTPResponse: """ Get version of services, see `spec_get_version`_. .. _spec_get_version: _static/api.html#operation/getVersion Resource is reached by address '/version' """ return self.success(outputJson=VERSION)