]> cat aescling's git repositories - mastodon.git/commitdiff
Add health endpoint to streaming API (#8441)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 26 Aug 2018 09:54:25 +0000 (11:54 +0200)
committerGitHub <noreply@github.com>
Sun, 26 Aug 2018 09:54:25 +0000 (11:54 +0200)
GET /api/v1/streaming/health

Answers with OK. Fix #8337

streaming/index.js

index b5f6dbd87ff369411cd842af07a327a4a4a9c21e..1c6004b77bde7060a14b6c8a8376e82bb020d6c4 100644 (file)
@@ -452,6 +452,12 @@ const startWorker = (workerId) => {
   app.use(setRequestId);
   app.use(setRemoteAddress);
   app.use(allowCrossDomain);
+
+  app.get('/api/v1/streaming/health', (req, res) => {
+    res.writeHead(200, { 'Content-Type': 'text/plain' });
+    res.end('OK');
+  });
+
   app.use(authenticationMiddleware);
   app.use(errorMiddleware);