From e7b64ea4988f8bac1d4e7cb07b51675554b40a06 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Fri, 29 Dec 2023 01:02:24 +0900 Subject: [PATCH] =?UTF-8?q?setting=20::=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 56 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 +++-- src/main.ts | 11 ++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index dc21d13..a9667d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@nestjs/core": "^10.2.7", "@nestjs/jwt": "^10.1.1", "@nestjs/platform-express": "^10.0.0", + "@nestjs/swagger": "^7.1.17", "@nestjs/typeorm": "^10.0.0", "cache-manager": "^5.2.3", "cache-manager-redis-yet": "^4.1.2", @@ -2510,6 +2511,25 @@ "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0" } }, + "node_modules/@nestjs/mapped-types": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.4.tgz", + "integrity": "sha512-xl+gUSp0B+ln1VSNoUftlglk8dfpUes3DHGxKZ5knuBxS5g2H/8p9/DSBOYWUfO5f4u9s6ffBPZ71WO+tbe5SA==", + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0", + "reflect-metadata": "^0.1.12" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, "node_modules/@nestjs/platform-express": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.3.0.tgz", @@ -2545,6 +2565,37 @@ "typescript": ">=4.8.2" } }, + "node_modules/@nestjs/swagger": { + "version": "7.1.17", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.17.tgz", + "integrity": "sha512-ASCxBrvMEN2o/8vEEmrIPMNzrr/hVi7QIR4y1oNYvoBNXHuwoF1VSI3+4Rq/3xmwVnVveJxHlBIs2u5xY9VgGQ==", + "dependencies": { + "@nestjs/mapped-types": "2.0.4", + "js-yaml": "4.1.0", + "lodash": "4.17.21", + "path-to-regexp": "3.2.0", + "swagger-ui-dist": "5.10.3" + }, + "peerDependencies": { + "@fastify/static": "^6.0.0", + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, "node_modules/@nestjs/testing": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.3.0.tgz", @@ -9894,6 +9945,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/swagger-ui-dist": { + "version": "5.10.3", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.10.3.tgz", + "integrity": "sha512-fu3aozjxFWsmcO1vyt1q1Ji2kN7KlTd1vHy27E9WgPyXo9nrEzhQPqgxaAjbMsOmb8XFKNGo4Sa3Q+84Fh+pFw==" + }, "node_modules/symbol-observable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", diff --git a/package.json b/package.json index 3bb74d1..c79e3a7 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,13 @@ "dependencies": { "@aws-sdk/client-s3": "^3.438.0", "@nestjs/cache-manager": "^2.1.0", + "@nestjs/cli": "^10.0.0", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.2.7", "@nestjs/jwt": "^10.1.1", "@nestjs/platform-express": "^10.0.0", + "@nestjs/swagger": "^7.1.17", "@nestjs/typeorm": "^10.0.0", "cache-manager": "^5.2.3", "cache-manager-redis-yet": "^4.1.2", @@ -38,8 +40,7 @@ "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "typeorm": "^0.3.17", - "typeorm-naming-strategies": "^4.1.0", - "@nestjs/cli": "^10.0.0" + "typeorm-naming-strategies": "^4.1.0" }, "devDependencies": { "@nestjs/schematics": "^10.0.0", diff --git a/src/main.ts b/src/main.ts index 13cad38..b64b62b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,19 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; async function bootstrap() { const app = await NestFactory.create(AppModule); + + const config = new DocumentBuilder() + .setTitle('afterschool API Docs') + .setDescription('방과후 신청 프로그램 api docs입니다.') + .setVersion('1.0') + .addTag('after') + .build(); + const document = SwaggerModule.createDocument(app, config); + SwaggerModule.setup('api', app, document); + await app.listen(3000); } bootstrap();