File size: 507 Bytes
b152fd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { Router } from "express";

export function apiDocsRoutes() {
  const router = Router();

  router.get("/", (req, res) => {
    res.json({
      endpoints: [
        {
          method: "GET",
          path: "/health",
          purpose: "Returns HTTP 200 when the app is ready and provides health information."
        },
        {
          method: "GET",
          path: "/api-docs",
          purpose: "Documents all available API endpoints."
        }
      ]
    });
  });

  return router;
}