{
  "slug": "swagger-docs",
  "runtimes": {
    "node": {
      "frameworks": {
        "express": {
          "dependencies": {
            "runtime": [
              "swagger-ui-express",
              "swagger-autogen"
            ],
            "dev": [
              "@types/swagger-ui-express"
            ]
          },
          "env": [],
          "architectures": {
            "mvc": {
              "files": [
                {
                  "type": "file",
                  "path": "swagger.config.ts",
                  "content": "import swaggerAutoGen from \"swagger-autogen\";\n\nconst doc = {\n  info: {\n    title: \"Servercn Express API\",\n    description: \"Servercn Express API documentation\",\n    version: \"1.0.0\"\n  },\n  host: \"localhost:3000\",\n  schemes: [\"http\"]\n};\n\nconst outputFile = \"./src/docs/swagger.json\"; // Output file for the generated docs\nconst endpointsFiles = [\"./src/routes/*.ts\"]; // Endpoints files to be parsed\n\nswaggerAutoGen(outputFile, endpointsFiles, doc);\n"
                },
                {
                  "type": "file",
                  "path": "src/app.swagger.ts",
                  "content": "import express from \"express\";\nimport { setupSwagger } from \"./configs/swagger\";\n\nconst app = express();\n\n// Initialize Swagger\nsetupSwagger(app);\n\napp.listen(8000, () => {\n  console.log(\"Server started on port 8000\");\n  console.log(\"Swagger docs available at http://localhost:8000/api/docs\");\n});\n"
                },
                {
                  "type": "file",
                  "path": "src/routes/health.routes.ts",
                  "content": "import { Router } from \"express\";\nconst router = Router();\n\nrouter.get(\"/v1/health/\", (req, res) => {\n  res.json({ message: \"Server is running\" });\n});\n\nexport default router;\n"
                },
                {
                  "type": "file",
                  "path": "src/docs/swagger.json",
                  "content": "{}\n"
                },
                {
                  "type": "file",
                  "path": "src/configs/swagger.ts",
                  "content": "import swaggerUi from \"swagger-ui-express\";\nimport { Express } from \"express\";\n\nimport swaggerDocument from \"../docs/swagger.json\"; // Generated by swagger-autogen by running `node src/swagger.config.ts`\n\nexport const setupSwagger = (app: Express) => {\n  if (process.env.NODE_ENV !== \"development\") return;\n  app.use(\"/api/docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument));\n};\n"
                }
              ]
            },
            "feature": {
              "files": [
                {
                  "type": "file",
                  "path": "swagger.config.ts",
                  "content": "import swaggerAutoGen from \"swagger-autogen\";\n\nconst doc = {\n  info: {\n    title: \"Servercn Express API\",\n    description: \"Servercn Express API documentation\",\n    version: \"1.0.0\"\n  },\n  host: `localhost:3000`,\n  schemes: [\"http\"]\n};\n\nconst outputFile = \"./src/docs/swagger.json\"; // Output file for the generated docs\nconst endpointsFiles = [\"./src/routes/*.ts\"]; // Endpoints files to be parsed\n\nswaggerAutoGen(outputFile, endpointsFiles, doc);\n"
                },
                {
                  "type": "file",
                  "path": "src/app.swagger.ts",
                  "content": "import express from \"express\";\nimport { setupSwagger } from \"./shared/configs/swagger\";\n\nconst app = express();\n\n// Initialize Swagger\nsetupSwagger(app);\n\napp.listen(8000, () => {\n  console.log(\"Server started on port 8000\");\n  console.log(\"Swagger docs available at http://localhost:8000/api/docs\");\n});\n"
                },
                {
                  "type": "file",
                  "path": "src/routes/health.routes.ts",
                  "content": "import { Router } from \"express\";\nconst router = Router();\n\nrouter.get(\"/v1/health/\", (req, res) => {\n  res.json({ message: \"Server is running\" });\n});\n\nexport default router;\n"
                },
                {
                  "type": "file",
                  "path": "src/docs/swagger.json",
                  "content": "{}\n"
                },
                {
                  "type": "file",
                  "path": "src/shared/configs/swagger.ts",
                  "content": "import swaggerUi from \"swagger-ui-express\";\nimport { Express } from \"express\";\n\nimport swaggerDocument from \"../../docs/swagger.json\";\n\nexport const setupSwagger = (app: Express) => {\n  if (process.env.NODE_ENV !== \"development\") return;\n  app.use(\"/api/docs\", swaggerUi.serve, swaggerUi.setup(swaggerDocument));\n};\n"
                }
              ]
            }
          }
        }
      }
    }
  }
}
