Skip to content
Permalink
Browse files

Add healthcheck πŸ†—

  • Loading branch information...
hugomd committed Jan 26, 2019
1 parent a7df1dc commit 2418e0af8b24aea943aab62af3a2dc9f4a532848
Showing with 6 additions and 0 deletions.
  1. +6 βˆ’0 index.js
@@ -72,6 +72,11 @@ const validateQuery = ({ flip }) => ({
});

const server = http.createServer((req, res) => {
if (req.url === '/healthcheck') {
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify({status: 'ok'}));
}

if (
req.headers &&
req.headers['user-agent'] &&
@@ -80,6 +85,7 @@ const server = http.createServer((req, res) => {
res.writeHead(302, { Location: 'https://github.com/hugomd/parrot.live' });
return res.end();
}

const stream = new Readable();
stream._read = function noop() {};
stream.pipe(res);

0 comments on commit 2418e0a

Please sign in to comment.
You can’t perform that action at this time.