Skip to content

Commit 8206b12

Browse files
committed
health
1 parent 85c3a6a commit 8206b12

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pages/health.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { GetServerSideProps } from 'next';
2+
3+
const HealthPage = () => {
4+
return <div>OK</div>;
5+
};
6+
7+
export const getServerSideProps: GetServerSideProps = async ({ req }) => {
8+
const userAgent = req.headers['user-agent'] || '';
9+
10+
if (userAgent !== 'service-status') {
11+
return {
12+
redirect: {
13+
destination: '/',
14+
permanent: false,
15+
},
16+
};
17+
}
18+
19+
return {
20+
props: {},
21+
};
22+
};
23+
24+
export default HealthPage;

0 commit comments

Comments
 (0)