RocketChat / RocketChat/homeserver

Implement /status Health Check Endpoint and Refactor Plugin Registration

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
16
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Description

Added a new root-status.controller.ts that provides two routes:

  • GET / — returns a simple welcome message

  • GET /status — returns server uptime, current timestamp, and status

  • Registered this controller plugin in homeserver.module.ts.

  • Also added a custom 404 error handler using app.onError for cleaner “not found” responses.

Key Code Snippets

root-status.controller.ts
import { Elysia } from 'elysia';

export const rootStatusPlugin = new Elysia()
  .get('/', () => ({
    message: 'Matrix server is live. Try /status.',
  }))
  .get('/status', () => ({
    status: 'ok',
    uptime: process.uptime(),
    timestamp: new Date().toISOString(),
  }));
homeserver.module.ts
app.onError(({ code }) => {
  if (code === 'NOT_FOUND') {
    return {
      error: 'Route not found. Are you lost?',
    };
  }
});

If this looks good, I’d be happy to create a PR for these changes. Please assign it to me if so, happy to contribute!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing root-status.controller.ts and homeserver.module.ts to understand the proposed plugin registration and error handling. Verify that GET / and GET /status return the described responses, and that an unknown route uses the custom not-found response; the issue does not mention a specific test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.