Skip to content

Commit

Permalink
help uptime bots
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna-devv committed Sep 1, 2022
1 parent 0582508 commit 33df3a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export const proxy = http_proxy.createProxyServer({

export async function requestManager(req, res) {

// Return success for uptime bots
if (req.url === '/__http_proxy_status') {
res.writeHead(200, {
'Content-Type': 'application/json'
});
return res.end(JSON.stringify({ success: true }));
};

// Return error if host isn't congifured
if (!hosts[req.headers.host]) {
res.writeHead(404, {
Expand Down

0 comments on commit 33df3a4

Please sign in to comment.