Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return generic '500' status on bootError page #8296

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

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.

@@ -29,7 +29,7 @@ function bootError(env, ctx) {
return '<dt><b>' + obj.desc + '</b></dt><dd>' + message.replace(/\\n/g, '<br/>') + '</dd>';
}).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

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.

1 participant