Skip to content

Commit

Permalink
Merge pull request #109 from supabase/remove-health-check
Browse files Browse the repository at this point in the history
feat: remove health check endpoint
  • Loading branch information
laktek authored May 29, 2023
2 parents d31f414 + 08186fa commit 7b15f96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 0 additions & 5 deletions crates/base/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ impl Service<Request<Body>> for WorkerService {
let fut = async move {
let req_uri = req.uri().clone();

// if the request is for the health endpoint return a 200 OK response
if req_uri.path() == "/_internal/health" {
return Ok(Response::new(Body::empty()));
}

let (res_tx, res_rx) = oneshot::channel::<Result<Response<Body>, hyper::Error>>();
let msg = WorkerRequestMsg { req, res_tx };

Expand Down
9 changes: 9 additions & 0 deletions examples/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ console.log('main function started');
serve(async (req: Request) => {
const url = new URL(req.url);
const { pathname } = url;

// handle health checks
if (pathname === '/_internal/health') {
return new Response(
JSON.stringify({ 'message': 'ok' }),
{ status: 200, headers: { 'Content-Type': 'application/json' } },
);
}

const path_parts = pathname.split('/');
const service_name = path_parts[1];

Expand Down

0 comments on commit 7b15f96

Please sign in to comment.