Dafa commited on
Commit
54022ee
·
verified ·
1 Parent(s): f0fb891

Create health/index.js

Browse files
Files changed (1) hide show
  1. pages/api/health/index.js +12 -0
pages/api/health/index.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default function handler(req, res) {
2
+ if (req.method === 'GET') {
3
+ res.status(200).json({
4
+ status: 'ok',
5
+ message: 'Server is running',
6
+ timestamp: new Date().toISOString(),
7
+ });
8
+ } else {
9
+ res.setHeader('Allow', ['GET']);
10
+ res.status(405).end(`Method ${req.method} Not Allowed`);
11
+ }
12
+ }