File size: 652 Bytes
0a51e30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { NextResponse } from 'next/server';

export async function GET() {
  return NextResponse.json({
    endpoints: [
      {
        method: "GET",
        path: "/health",
        purpose: "Returns HTTP 200 when the app is ready. Required for Hugging Face to transition the Space from starting to running.",
        request: {},
        response: {
          status: "ok"
        }
      },
      {
        method: "GET",
        path: "/api-docs",
        purpose: "Documents all available API endpoints.",
        request: {},
        response: {
          endpoints: "Array of endpoint objects"
        }
      }
    ]
  }, { status: 200 });
}