RafalWilinski / express-status-monitor

🚀 Realtime Monitoring solution for Node.js/Express.js apps, inspired by status.github.com, sponsored by https://dynobase.dev
https://dynobase.dev/
MIT License
3.59k stars 253 forks source link

```healthcheck``` Failed for succesful host request #195

Open brunolnetto opened 1 year ago

brunolnetto commented 1 year ago

Hi,

I develop in NodeJS. I would like to assign the /healthcheck on status-monitor initialization. The library provides a clear way to achieve it. However, even though I follow the given instructions, the route /status still gives the response "FAILED", even though the app is healthy. The healthCheck controller as well as library import and router are below.

import express from 'express';
export const router = express.Router();

export const healthCheck = async (req, res, next) => {
  log('debug', 'healthCheck controller called');

  res.status = 200;

  res.send({
    message: 'Sappio server running',
    version: pkg.version,
  })
}

router.get(
  '/healthcheck', 
  healthCheck
);

Do you know the reason for this non-working scenario?