Skip to content

Commit 8cc10fa

Browse files
committed
feat: use scalar ui
1 parent 9429d65 commit 8cc10fa

File tree

3 files changed

+92
-47
lines changed

3 files changed

+92
-47
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"doc:serve": "npx compodoc -p tsconfig.json -n \"Documentation\" -s"
3838
},
3939
"dependencies": {
40-
"@apollo/server": "^4.10.0",
41-
"@nanogiants/nestjs-swagger-api-exception-decorator": "^1.6.11",
40+
"@apollo/server": "^4.11.3",
41+
"@nanogiants/nestjs-swagger-api-exception-decorator": "^1.7.2",
4242
"@nestjs/apollo": "^13.0.2",
4343
"@nestjs/common": "^11.0.9",
4444
"@nestjs/config": "^4.0.0",
@@ -49,6 +49,7 @@
4949
"@nestjs/platform-express": "^11.0.9",
5050
"@nestjs/swagger": "^11.0.3",
5151
"@nestjs/terminus": "^11.0.0",
52+
"@scalar/nestjs-api-reference": "^0.4.1",
5253
"bcrypt": "^5.1.1",
5354
"class-transformer": "^0.5.1",
5455
"class-validator": "^0.14.1",
@@ -58,14 +59,13 @@
5859
"graphql": "^16.8.1",
5960
"helmet": "^7.1.0",
6061
"kysely": "^0.27.5",
61-
"nestjs-pino": "^4.0.0",
62+
"nestjs-pino": "^4.3.1",
6263
"pg": "^8.11.3",
6364
"pino-http": "^9.0.0",
6465
"pino-pretty": "^10.3.1",
6566
"reflect-metadata": "^0.2.1",
6667
"rimraf": "^5.0.5",
6768
"rxjs": "^7.8.1",
68-
"swagger-ui-express": "^5.0.0",
6969
"uuid": "^9.0.1"
7070
},
7171
"devDependencies": {

pnpm-lock.yaml

Lines changed: 82 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { BaseExceptionsFilter } from './common/filters/base-exception.filter';
99
import { ValidationException } from './common/exceptions/validation.exception';
1010
import { AllExceptionsFilter } from 'common/filters/all-exception.filter';
1111
import rawBodyMiddleware from 'utils/rawBody.middleware';
12+
import { apiReference } from '@scalar/nestjs-api-reference';
1213

1314
async function bootstrap() {
1415
const app = await NestFactory.create(AppModule, {
@@ -93,7 +94,11 @@ async function bootstrap() {
9394
const document = SwaggerModule.createDocument(app, openApiConfig, {
9495
deepScanRoutes: true,
9596
});
96-
SwaggerModule.setup('api-docs', app, document);
97+
SwaggerModule.setup('api-docs', app, document, {
98+
ui: false,
99+
});
100+
101+
app.use('/api-docs', apiReference({ content: document }));
97102

98103
await app.listen(port, () => {
99104
logger.log(`Application started at port:${port}`);

0 commit comments

Comments
 (0)