Source code for luna_sender.app.handlers.version_handler

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

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

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


[docs]class VersionHandler(BaseSenderRequestHandler): """ Handler for getting version """
[docs] @timer async def get(self) -> HTTPResponse: """ Get service version. See `spec_get_version`_. .. _spec_get_version: _static/api.html#operation/getVersion Returns: response with service version """ return self.success(outputJson=VERSION)