-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: /health endpoint #1898
feat: /health endpoint #1898
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
apps/web/app/health/error.tsxReact components re-render by default whenever their parent component re-renders, even if their props haven't changed. This can lead to unnecessary re-rendering and a performance hit. To avoid this, you can use React.memo to memoize your component. This will make it so your component only re-renders when its props change. export default React.memo(Error);
|
export default function Error({ error }: { error: Error & { digest?: string } }) { | ||
return ( | ||
<div className="mx-auto flex h-full max-w-xl flex-col items-center justify-center text-center"> | ||
<XCircleIcon height={40} color="red" /> | ||
<p className="text-md mt-4 font-bold text-zinc-900">Your Formbricks health is degraded</p> | ||
<p className="text-sm text-zinc-900">{error.message}</p> | ||
</div> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapped the Error component with React.memo to prevent unnecessary re-rendering when the props haven't changed, improving performance.
export default function Error({ error }: { error: Error & { digest?: string } }) { | |
return ( | |
<div className="mx-auto flex h-full max-w-xl flex-col items-center justify-center text-center"> | |
<XCircleIcon height={40} color="red" /> | |
<p className="text-md mt-4 font-bold text-zinc-900">Your Formbricks health is degraded</p> | |
<p className="text-sm text-zinc-900">{error.message}</p> | |
</div> | |
); | |
} | |
export default React.memo(Error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShubhamPalriwala thanks a lot for the quick turnaround. Looks great! 😊
@ShubhamPalriwala unfortunately we are getting build errors in the pipeline. Can you please take a look :-) |
…ub.com/formbricks/formbricks into shubham/for-1683-add-health-check-page
What does this PR do?
/health
endpoint checks if the system is running as expected or not! Throws UI + status code (200 or not) accordingly.Fixes #1840
How should this be tested?
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated