Новые роуты API для статистики и мониторинга
- /api/version - /api/health - /api/stats
This commit is contained in:
@@ -49,8 +49,9 @@ class BasicController
|
||||
* @param array $data
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
protected function responseJson(ResponseInterface $response, int $status, array $data): ResponseInterface
|
||||
protected function responseJson(ResponseInterface $response, int $status, mixed $data): ResponseInterface
|
||||
{
|
||||
is_scalar($data) && $data = [$data];
|
||||
$data = array_merge(['timestamp' => time()], $data);
|
||||
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user