This project uses Swagger/OpenAPI for API documentation.
Once the server is running, you can access the Swagger UI at:
http://localhost:3000/api-docs
(Replace 3000 with your actual server port if different)
To document a new endpoint, add JSDoc comments with Swagger annotations above your route handler. Here's an example:
/**
* @swagger
* /api/v1/example:
* get:
* summary: Example endpoint
* description: This is an example endpoint
* tags: [Example]
* responses:
* 200:
* description: Success
* content:
* application/json:
* schema:
* type: object
* properties:
* status:
* type: string
* example: success
*/
router.get('/example', exampleHandler);The Swagger configuration is located in src/docs/swagger.config.ts. You can modify:
- API information (title, version, description)
- Server URLs
- Security schemes (JWT, API keys, etc.)
- Common schemas
- Tags for grouping endpoints
- Auth: Authentication endpoints
- System: System status and configuration endpoints
- Devices: Device management endpoints