@opexa/portal-components 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,17 +10,17 @@ export declare const GET: (request: NextRequest, { params }: {
10
10
  auth: string[];
11
11
  }>;
12
12
  }) => Promise<NextResponse<{
13
- ok: false;
14
- message: string;
15
- } | {
16
- ok: true;
17
- data: GetSessionResponse;
18
- }> | NextResponse<{
19
13
  ok: true;
20
14
  data?: never;
21
15
  } | {
22
16
  ok: false;
23
17
  message: string;
18
+ }> | NextResponse<{
19
+ ok: false;
20
+ message: string;
21
+ } | {
22
+ ok: true;
23
+ data: GetSessionResponse;
24
24
  }>>;
25
25
  export declare const DELETE: (request: NextRequest, { params }: {
26
26
  params: Promise<{
package/dist/handlers.js CHANGED
@@ -35,6 +35,25 @@ const AuthenticateDefinition = z.object({
35
35
  export const GET = async (request, { params }) => {
36
36
  const { auth } = await params;
37
37
  const path = auth[0];
38
+ /*
39
+ *
40
+ * GET -> /api/health
41
+ * GET -> /api/healthcheck
42
+ * GET -> /api/health-check
43
+ *
44
+ */
45
+ if (/^health(-?check)?$/i.test(path)) {
46
+ return NextResponse.json({
47
+ ok: true,
48
+ }, {
49
+ headers: {
50
+ 'Access-Control-Allow-Origin': '*',
51
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
52
+ Pragma: 'no-cache',
53
+ Expires: '0',
54
+ },
55
+ });
56
+ }
38
57
  /*
39
58
  *
40
59
  * GET -> /api/sessions