mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(server): add swagger setup for public api documentation
Introduces Swagger and OpenAPI documentation generation for the backend API. Configures bearer authentication globally while allowing explicit bypasses for public endpoints. Exports nested DTO classes across several modules so the NestJS Swagger plugin can correctly reflect their schema definitions. Closes #399
This commit is contained in:
@@ -10,6 +10,19 @@ Server only: `pnpm start:dev` (from this directory).
|
||||
|
||||
The server loads environment variables from `.env` in this directory. See `.env.example` for all available options.
|
||||
|
||||
## API docs
|
||||
|
||||
Generated OpenAPI docs are disabled by default. Enable them with `SWAGGER_ENABLED=true`:
|
||||
|
||||
```bash
|
||||
SWAGGER_ENABLED=true pnpm start:dev
|
||||
```
|
||||
|
||||
Then open:
|
||||
|
||||
- Swagger UI: http://localhost:3000/api/docs
|
||||
- OpenAPI JSON: http://localhost:3000/api/docs-json
|
||||
|
||||
## Module structure
|
||||
|
||||
Each feature is a self-contained NestJS module under `src/modules/`:
|
||||
|
||||
Reference in New Issue
Block a user