devlog_owen
231227 [TIL] typescript,nest.js 공연예매사이트 만들기 2일차 본문
에러 해결1
ERROR [ExceptionHandler] Nest can't resolve dependencies of the TypeOrmCoreModule (TypeOrmModuleOptions, ?). Please make sure that the argument ModuleRef at index [1] is available in the TypeOrmCoreModule context.
Potential solutions:
- Is TypeOrmCoreModule a valid NestJS module?
- If ModuleRef is a provider, is it part of the current TypeOrmCoreModule?
- If ModuleRef is exported from a separate @Module, is that module imported within TypeOrmCoreModule?
@Module({
imports: [ /* the Module containing ModuleRef */ ]
})
이런 typeormmodule이 유효하지않는둥 오류를 뱉어낸 터미널. 구글링한 결과 다행히 바로 해결할 수 있었다.
Nest can't resolve dependencies of the TypeOrmCoreModule
src/contact/contact.module.ts import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ContactController } from './contact.controller'; import { Contact } ...
stackoverflow.com
1- Delete node_module
2- Run npm i
3- Run npm install --save @nestjs/typeorm typeorm mysql2 again im my project.
2,3번만으로 서버가 돌아갔다.
rest client: swagger 실행
https://jhyeok.com/nestjs-swagger/
https://jhyeok.com/nestjs-swagger/
이 글은 NestJS에서 Swagger를 사용하면서 정리한 글입니다. 이 글에서 사용된 코드는 여기에서 확인할 수 있습니다. Swagger란? Swagger는 API 문서 자동화 도구이다. 이전의 프로젝트에서 사용한 경험으
jhyeok.com
팀원분들 중 지엽님이 nest.js는 swagger와 같이 쓰면 편하다고 하시길래 해봤는데 아직 설정하는 법이 좀 서툴러서 좀 어려운거같다. 스웨거용 DTO도 만들고 컨트롤러와 메인.TS에 각각 스웨거 코드 넣어서 회원가입까지는 어떻게 만든듯.
회원가입, 로그인기능 완료
/필수기능/
메인-앱모듈-AUTH 모듈 설치-jwt.strategy-AUTH 모듈
/유저기능/
유저모듈,서비스,컨트롤러설치- 유저롤타입파일-유저엔티티-로그인dto-유저인포dto(커스텀)
/유저기능 본격구현/
유저컨트롤러-유저서비스-유저모듈-앱모듈수정-jwt.strategy수정
1. 필수기능: main.ts 먼저 작성하고 app.module, auth.module, jwt.strategy 작성했다.
2: 유저기능: user.role.type, userentity,register,login.dto, userinfo.dto,user.controller,service순으로 작성.
'TIL' 카테고리의 다른 글
231229 [TIL]TYPEORM을 쓰면 따로 레파지토리 파일을 안만들어도 되는 이유 (0) | 2024.01.02 |
---|---|
231228 [TIL] 개인프로젝트 3일차 (1) | 2023.12.29 |
231226 [TIL] 개인프로젝트 시작 (0) | 2023.12.27 |
231222 [TIL] JS 소수 구하기, 노마드코더 nest.js 강의 (1) | 2023.12.23 |
231221 [TIL] 타입스크립트 디자인패턴 (1) | 2023.12.22 |