From 3f0595c04aa69babebb8ca0f49e0f8668918570a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 19 Oct 2020 18:09:27 +0300 Subject: [PATCH] Test realtime server --- app/controllers/api/health.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 5ef4f2b9c8..dc14fffff0 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -30,6 +30,19 @@ App::get('/v1/health/version') $response->json(['version' => APP_VERSION_STABLE]); }, ['response']); +App::get('/v1/health/realtime') + ->desc('Get Realtime') + ->groups(['api', 'health']) + ->label('scope', 'public') + ->action(function ($response) { + /** @var Utopia\Response $response */ + $redis = new Redis(); + $redis->connect('redis', 6379); + + $redis->publish('realtime', 'I\'m a live message'); + $response->json(['status' => 'OK']); + }, ['response']); + App::get('/v1/health/db') ->desc('Get DB') ->groups(['api', 'health'])