Source code for luna_tasks.common.handlers.version_handler
# -*- coding: utf-8 -*-
"""Version Handler
Module realize version handler.
"""
from sanic.response import HTTPResponse
from app.version import VERSION
from common.handlers.base_handler import CommonBaseHandler
from crutches_on_wheels.utils.timer import timer
[docs]class VersionHandler(CommonBaseHandler):
"""
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)