added version command and api endpoint (#321)
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\API;
|
||||
|
||||
use App\Constants;
|
||||
use FOS\RestBundle\Controller\Annotations as Rest;
|
||||
use FOS\RestBundle\View\View;
|
||||
use FOS\RestBundle\View\ViewHandlerInterface;
|
||||
@@ -46,4 +47,25 @@ class HealthcheckController extends Controller
|
||||
|
||||
return $this->viewHandler->handle($view);
|
||||
}
|
||||
|
||||
/**
|
||||
* @SWG\Response(
|
||||
* response=200,
|
||||
* description="Returns version information about the current release",
|
||||
* )
|
||||
*
|
||||
* @Rest\Get(path="/version")
|
||||
*/
|
||||
public function versionAction()
|
||||
{
|
||||
$version = [
|
||||
'version' => Constants::VERSION,
|
||||
'candidate' => Constants::STATUS,
|
||||
'semver' => Constants::VERSION . '-' . Constants::STATUS,
|
||||
'name' => Constants::NAME,
|
||||
'copyright' => 'Kimai 2 - ' . Constants::VERSION . ' ' . Constants::STATUS . ' (' . Constants::NAME . ') by Kevin Papst and contributors.',
|
||||
];
|
||||
|
||||
return $this->viewHandler->handle(new View($version, 200));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user