From 8206b12306ce413f67bd5ae0cf2b1c3c8300ca1d Mon Sep 17 00:00:00 2001 From: Sritan Motati Date: Wed, 5 Feb 2025 16:54:55 -0500 Subject: [PATCH] health --- pages/health.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/health.tsx diff --git a/pages/health.tsx b/pages/health.tsx new file mode 100644 index 00000000..655eb6fe --- /dev/null +++ b/pages/health.tsx @@ -0,0 +1,24 @@ +import { GetServerSideProps } from 'next'; + +const HealthPage = () => { + return
OK
; +}; + +export const getServerSideProps: GetServerSideProps = async ({ req }) => { + const userAgent = req.headers['user-agent'] || ''; + + if (userAgent !== 'service-status') { + return { + redirect: { + destination: '/', + permanent: false, + }, + }; + } + + return { + props: {}, + }; +}; + +export default HealthPage;