Test realtime server
This commit is contained in:
parent
210fa9fd64
commit
3f0595c04a
1 changed files with 13 additions and 0 deletions
|
@ -30,6 +30,19 @@ App::get('/v1/health/version')
|
||||||
$response->json(['version' => APP_VERSION_STABLE]);
|
$response->json(['version' => APP_VERSION_STABLE]);
|
||||||
}, ['response']);
|
}, ['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')
|
App::get('/v1/health/db')
|
||||||
->desc('Get DB')
|
->desc('Get DB')
|
||||||
->groups(['api', 'health'])
|
->groups(['api', 'health'])
|
||||||
|
|
Loading…
Reference in a new issue