본문 바로가기

Research/Nest.js32

nestjs_RDS Postgres 인스턴스 생성 및 nestjs 모듈 설치 RDS DB 생성 퍼블릭 엑세스 허용 DB 생성 완료. 보안그룹 인바운드 규칙 설정 Postgres는 5432 포트를 사용한다. 인바운드 규칙에서 5432 포트를 열어주자. 잘 연결이 되는지 DBeaver에서 테스트로 열어보겠다. 잘 열린다. TypeORM 모듈 설치 Nest는 TypeORM을 기본적으로 제공한다. ORM을 쓰면 추상적으로 DB를 제어할 수 있다는 점에서 유용하다. 공식문서에서는 mysql 사용 예시를 보여주고 있는데, 나는 postgreSQL을 사용할 것이다. 왜냐하면 이것은 오픈소스이기 때문이다. $ npm install --save @nestjs/typeorm typeorm pg @nestjs/typeorm : typeORM 연동을 위한 모듈 typeorm : typeORM 모듈 p.. 2023. 4. 15.
nestjs_view 엔진 적용하기(hbs) npm install --save hbs handlebars 뷰 엔진 설치 import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { NestExpressApplication } from '@nestjs/platform-express'; import { join } from 'path'; async function bootstrap() { // const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule); /** * for applying MVC pattern * _dirname : .. 2023. 4. 13.
nestjs_특정 버전으로 nest 설치하는 방법 // nest.js 글로벌 버전 변경 sudo npm install -g @nestjs/cli@8.2.6 // 버전확인 nest --version 8.2.6 2023. 4. 12.
nestjs_swagger API 보안 설정 nest.js swagger API 페이지 보안 설정하기 express-basic-auth(https://www.npmjs.com/package/express-basic-auth) express 라이브러리이지만 nest.js를 express 기반으로 설정했다면 문제없이 사용할 수 있다. npm install express-basic-auth // main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { HttpExceptionFilter } from './common/exceptions/http-exception.filter'; import { ValidationPipe } fr.. 2023. 4. 8.