Skip to content

Conversation

@daaanosaur
Copy link

@daaanosaur daaanosaur commented Sep 24, 2024

Currently Nightscout Web Monitor does not return a HTTP error status code when displaying the bootError page.

This means that while users can see there is a problem with the application, platforms it may be deployed on cannot.

Returning a 500 status error in this case will at least enable health checks to be performed and deployments to be restarted when there's an issue with the application.

}).join(' ');

res.render('error.html', {
res.status(500).render('error.html', {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://expressjs.com/en/api.html#res.status

This returns a 500 error http status in the header, rather than the default 200 ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I love it.

@bewest bewest merged commit d7c93b4 into nightscout:dev Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants