Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The API will be available at `http://localhost:3000` (default).
## API Documentation

Once the server is running, you can access the API documentation (Swagger UI) at:
`http://localhost:3000/api-docs`
`http://localhost:3000/docs`

## Running Tests

Expand Down
4 changes: 2 additions & 2 deletions src/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import contactRouter from '../routes/contact.route';
import adminRouter from '../routes/admin.route';
import { notFoundHandler } from '../middleware/not-found.middleware';
import swaggerUi from 'swagger-ui-express';
import { swaggerSpec } from '../utils/swagger';
import { swaggerSpec, swaggerUiOptions } from '../utils/swagger';

const router = express.Router();

router.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
router.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec, swaggerUiOptions));

router.use('/', homeRouter);
router.use('/', authRouter);
Expand Down
12 changes: 12 additions & 0 deletions src/utils/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,15 @@ const options: swaggerJsdoc.Options = {
};

export const swaggerSpec = swaggerJsdoc(options);

export const swaggerUiOptions = {
explorer: true,
customCssUrl: 'https://unpkg.com/swagger-ui-dist@5.17.14/swagger-ui.css',
customJs: [
'https://unpkg.com/swagger-ui-dist@5.17.14/swagger-ui-bundle.js',
'https://unpkg.com/swagger-ui-dist@5.17.14/swagger-ui-standalone-preset.js',
],
swaggerOptions: {
url: '/docs/json',
},
};
Loading