inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

docker-compose up 이후 shut down 로그가 나오며 postgres-data에 데이터가 생성되지 않습니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요. 강의 보면서 docker-compose 파일 만들고 실행하다가 막히는 부분이 있어 질문드립니다. os ubuntu 20.04 docker version Docker version 24.0.2, build cb74dfc docker-compose file services: postgres: image: postgres:15 restart: always volumes: - ./postgres-data:/var/lib/postgresql/data ports: - '5432:5432' environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres terminal log [+] Running 1/0 ✔ Container nestjs_sns_server-postgres-1 Created 0.0s Attaching to nestjs_sns_server-postgres-1 nestjs_sns_server-postgres-1 | The files belonging to this database system will be owned by user "postgres". nestjs_sns_server-postgres-1 | This user must also own the server process. nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | The database cluster will be initialized with locale "en_US.utf8". nestjs_sns_server-postgres-1 | The default database encoding has accordingly been set to "UTF8". nestjs_sns_server-postgres-1 | The default text search configuration will be set to "english". nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | Data page checksums are disabled. nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok nestjs_sns_server-postgres-1 | creating subdirectories ... ok nestjs_sns_server-postgres-1 | selecting dynamic shared memory implementation ... posix nestjs_sns_server-postgres-1 | selecting default max_connections ... 100 nestjs_sns_server-postgres-1 | selecting default shared_buffers ... 128MB nestjs_sns_server-postgres-1 | selecting default time zone ... Etc/UTC nestjs_sns_server-postgres-1 | creating configuration files ... ok nestjs_sns_server-postgres-1 | running bootstrap script ... ok nestjs_sns_server-postgres-1 | performing post-bootstrap initialization ... ok nestjs_sns_server-postgres-1 | syncing data to disk ... ok nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | Success. You can now start the database server using: nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | pg_ctl -D /var/lib/postgresql/data -l logfile start nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | initdb: warning: enabling "trust" authentication for local connections nestjs_sns_server-postgres-1 | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. nestjs_sns_server-postgres-1 | waiting for server to start....2024-01-17 13:05:30.755 UTC [49] LOG: starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.760 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.777 UTC [52] LOG: database system was shut down at 2024-01-17 13:05:30 UTC nestjs_sns_server-postgres-1 | 2024-01-17 13:05:30.786 UTC [49] LOG: database system is ready to accept connections nestjs_sns_server-postgres-1 | done nestjs_sns_server-postgres-1 | server started ... nestjs_sns_server-postgres-1 | nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: starting PostgreSQL 15.5 (Debian 15.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.440 UTC [1] LOG: listening on IPv6 address "::", port 5432 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.450 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.463 UTC [29] LOG: database system was shut down at 2024-01-17 13:30:21 UTC nestjs_sns_server-postgres-1 | 2024-01-17 13:30:30.473 UTC [1] LOG: database system is ready to accept connections nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.019 UTC [1] LOG: received fast shutdown request nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.024 UTC [1] LOG: aborting any active transactions nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.025 UTC [1] LOG: background worker "logical replication launcher" (PID 32) exited with exit code 1 nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.025 UTC [27] LOG: shutting down nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.030 UTC [27] LOG: checkpoint starting: shutdown immediate nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.063 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.011 s, sync=0.005 s, total=0.038 s; sync files=2, longest=0.003 s, average=0.003 s; distance=0 kB, estimate=0 kB nestjs_sns_server-postgres-1 | 2024-01-17 13:30:33.069 UTC [1] LOG: database system is shut down (1만자 이하로 작성해야 해서 로그는 중간 생략하였습니다.) docker-comopse 파일이 정상적으로 실행이 되고 있는 상황인데 Postgresql 데이터 베이스 연결하면서 문제가 발생하고 있는것 같습니다. 프로젝트 폴더의 postgres-data 폴더에도 postgresql 데이터가 생성되지 않았구요. 혹시 제가 잘못하고 있는 부분이 있을까요..?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
jurjur 댓글 1 좋아요 0 조회수 394

오류 메시지는 어디서 작성하는 것이 좋을까요?

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

사용자에게 (프로그램을 사용하는 고객) 오류 메시지를 보낸다고 할 때는 백엔드에서 메시지를 만들어 보내는 것이 좋을까요? 아니면 프론트엔드에서 메시지를 만들어서 보이는 것이 좋을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
kimgni.dev 댓글 1 좋아요 1 조회수 333

경로 관련 궁금증

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

경로 관련 궁금한 점이 있습니다. 경로에 join 을 이용하는 이유가 os 에 따라 경로 구분자가 다르기 때문으로 이해하고 있습니다. 그런데 join 앞에는 하드 코딩으로 / 를 붙이는 게 보이는데 이부분도 배포 os 를 대비해야하지 않을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
kimgni.dev 댓글 1 좋아요 0 조회수 240

nest g resource관련 질문

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

저 명령어로 posts을 만들고 나서 파일을 삭제하였다가 다시 posts를 만들고 서버를 실행하였는데 사진과 같은 오류가 생겼습니다. app.module.ts 파일에는 저런 코드가 없는데 왜 그런지 알려주세요. 그리고 올바르게 posts리소스를 삭제하는 방법을 알려주세요.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
코린이 댓글 1 좋아요 0 조회수 343

put요청과 post요청의 차이는 뭘까요?

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드팩토리 통합 링크 https://links.codefactory.ai Flutter 강의를 구매하시면 코드팩토리 디스코드 서버 플러터 프리미엄 채널에 들어오실 수 있습니다! 디스코드 서버에 들어오시고 저에게 메세지로 강의를 구매하신 이메일을 보내주시면 프리미엄 채널에 등록해드려요! 프리미엄 채널에 들어오시면 모든 질의응답 최우선으로 답변해드립니다! 안녕하세요! 공부하다 궁금해서요 post도 추가할 수 있고 결국 put도 추가할 수 있는데 그럼 post랑 put의 차이점은 명확하게 뭘까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
찬찬잉 댓글 1 좋아요 0 조회수 367

Ioc 컨테이너에서 관리 중인 인스턴스는 클래스마다 하나씩만 존재할까요?

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요. 섹션 7. 의존성 주입과 제어의 역전에 대해 보고 있습니다. 해당 부분을 보다가 의문점이 생겼습니다. 만약 B라는 클래스가 동시에 두군데에서 필요하다면 Ioc 컨테이너는 B 인스턴스를 두개를 생성해서 주입하나요? 아니면, 인스턴스는 무조건 하나만 생성하여 참조값으로 주입하는 건가요? 답변해주시면 감사하겠습니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
wookim 댓글 1 좋아요 1 조회수 398

diskStorage 사용관련 에러 문의

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요. storage코드 작성 후 diskStorage관련하여 TypeError가 발생하였습니다. 강의 내용과 동일하게 작성을 하였는데 빌드 시 해당에러가 발생하고 diskStorage의 인자에 아무것도 넣지 않아도 동일한 에러가 발생하는데 원인이 무엇인지 알 수가 없어서 글을 올립니다. module 코드입니다. error_msg코드입니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
bluelf1004 댓글 3 좋아요 0 조회수 541

안녕하세요:) Websocket사용 용도 질문드립니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

강의 완강하고 요즘 연습하면서 한 가지 궁금증이 생겨서 질문드립니다. websocket 사용 용도가 실시간 커뮤니케이션이라고 알고 있는데요 인스타그램으로 예를 들면 다른 사람을 팔로우하면 바로 팔로우 카운트가 실시간으로 올라가는 거랑 유튜브에 댓글들이 실시간으로 생기는 방식들이 전부 webscoket으로 구현하는 게 맞나요?? 인스타처럼 상대방을 팔로우하면 제 팔로잉 카운트가 증가하는 동시에 상대방의 팔로워 카운트가 증가하는 로직을 만들었는데 곰곰이 생각해 보니 팔로우 카운트 증가는 제가 어떠한 http요청 없이 실시간으로 올라가고 내려가는데, 일반적인 api로직을 만드는 방식으로 하는 게 맞나 하는 의문이 생겨서 질문드렸습니다~

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
5km 댓글 1 좋아요 0 조회수 336

영상을 멈추고 한번 풀어 보았습니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

//query-runner.decorator.ts import { ExecutionContext, InternalServerErrorException, createParamDecorator, } from '@nestjs/common'; import { QueryRunner } from 'typeorm'; export const QueryRunnerDecorator = createParamDecorator( (data: unknown, context: ExecutionContext): { qr: QueryRunner } => { const req = context.switchToHttp().getRequest(); if (!req.queryRunner) { throw new InternalServerErrorException('queryRunner가 없습니다.'); } return { qr: req.queryRunner, }; }, ); //posts.controller.ts @Post() @UseGuards(AccessTokenGuard) @UseInterceptors(TransactionInterceptoer) async postPosts( @User('id') userId: number, @Body() body: CreatePostDto, @QueryRunnerDecorator() qr: QueryRunner, ) { .... 중략 } 트랜잭션을 interceptor로 관리하는것을 배워서 너무 유익하고 100점 만점의 100점 꿀팁이었습니다. https://www.npmjs.com/package/typeorm-transactional 해당 라이브러리를 원래 사용 했으나, 마음에 들지 않았었는데 덕분에 interceptor로 대체 할 수 있을것 같습니다 좋은 강의 만들어 주셔서 감사합니다!

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 1 좋아요 0 조회수 268

transaction interceptor을 사용할때 validation이 안되는 문제

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

transaction interceptor을 사용할때 body field validation이 안되는 문제가 발생하여 query runner와 transaction interceptor 두코들 제외 하니 validationdl 다시 되었습니다. 혹시 어떤문제인지 알수 있을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
정의진 댓글 1 좋아요 0 조회수 303

섹션별로 강의 파일 다운받을 수 있나요?

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

아는 부분은 제외하고 모르는 부분만 골라서 들으려는데 올려주신 깃허브 리포지토리에는 완성본만 남아있더라구요 혹시 각 섹션별로 강의 파일을 받을 수 있는 링크가 있을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
박민 댓글 1 좋아요 0 조회수 224

Part2 에 대해서 궁금합니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

Part 1 에서 웬만한 건 다 배우는 것 같은데 Part 2 는 어떤 내용이고 언제쯤 공개되나요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
제이크서 댓글 1 좋아요 0 조회수 335

올려두신 github 레포지토리를 그대로 실행 시 오류가 발생합니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

맨 처음 클론하고 나면 chats.gateway.ts 에서 socket.user라는 프로퍼티를 찾을 수 없다는 에러가 뜨고 있습니다. 에러가 나는 로직을 전체 주석시키고 나면, CommentsService에서 CommonService의 의존성을 찾을 수 없다는 에러가 뜹니다. ("Nest can't resolve dependencies of the CommentsService (CommentsModelRepository, ?)") CommonSerivce 의존성을 해결하고 나니 "TypeORMError: Entity metadata for UsersModel#postComments was not found." 라는 에러가 뜹니다. 위 에러를 고치고 나니 또 다른 에러가 뜨고 있습니다. 혹시 github 레포지토리 clone 해보셨을 때 문제 없는지 확인 가능 하실까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
한글영문대소문자 댓글 2 좋아요 0 조회수 448

맥북 pro m1칩 권한 문제

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

파일 '/Users/제이름입니다/Desktop/book_lecture/inflearn/code-factory/typeorm_test/docker-compose.yaml'(NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/Users/bonhyunkoo/Desktop/book_lecture/inflearn/code-factory/typeorm_test/docker-compose.yaml')을(를) 쓸 수 없음 docker-compose.yaml 파일 생성시 나타나는 에러입니다. 환경은 mac pro m1칩이고 vscode에서 실습 중입니다. 사실 원래는 문제 없다가 뒤늦게 mac os 환경세팅 강의에 나오는 sudo corepack enable 명령어 입력 후 권한 문제가 계속 나오네요 위의 도커 파일 뿐만 아니라 typeorm을 비롯한 라이브러리 설치시에도 항상 sudo를 입력해줘야하는 등 문제가 계속 발생하는데 왜 그런걸까요? 해결법은 뭔가요? sudo corepack enable이란 명령어는 어떤 의미를 가지고 있는 건가요? 밑은 라이브러리 설치시 나타나는 에러입니다. yarn add @nestjs/typeorm typeorm pg yarn add v1.22.21 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error Error: EACCES: permission denied, unlink '/Users/제이름입니다/Desktop/book_lecture/inflearn/code-factory/typeorm_test/node_modules/.yarn-integrity' info Visit https://yarnpkg.com/en/docs/cli/ad d for documentation about this command.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
Gose 댓글 1 좋아요 0 조회수 350

정렬에 대한 질문

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요, postman으로 테스트해보다가 궁금한것이 있어 질문 올려요. 질문 전에 base-pagination.dto.ts 에서 order__createdAt의 기본값은 없앤 상태일 때 likeCount DESC 같은것으로 정렬한다면, where__id__... 를 어떻게 해야할지.. 테스트해보니 생각한것처럼 나오지 않아서요. 커서 페이지네이션은 이렇게 쓰면 안되는것인지.. 궁금합니다. 예) 배달비 순으로 정렬, 금액 순으로 정렬 이런것들이요. 감사합니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
백성현 댓글 1 좋아요 1 조회수 280

파이프 관련 질문있습니다.

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

위 예제에서 value의 타입이 string 혹은 number가 아니라 any인 이유가 궁금합니당..

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
당황한 노새 댓글 1 좋아요 0 조회수 268

jetbrain에서 디버거 사용

해결됨

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요, 젯브레인 사용중이라 혹시 도움될까싶어 글 남겨요. 버전에 따라 조금씩 다를지 모르겟는데, 우측 상단에 Current File > Edit Configurations... 클릭 Run/Debug Configurations 화면에서 + 또는 Add new... 클릭 NodeJS 선택 후 Name은 Debug로 입력 그리고 아래 Configuration 탭에서 Node Parameters: node_modules/@nestjs/cli/bin/nest.js start --debug --watch Javascript File: src/main.ts 그리고 Apply, OK 로 설정 완료 후 처음 Current File 부분이 Debug로 변경되어있는것 확인 후, 우측 실행버튼 클릭 그러면 하단에 실행 화면이 나오는데, 스크롤 위로 올려보면 ws://127.0.0.1:..../aaaa-bbbb-cccc-dddd 링크 클릭 > Threads & Variables 탭 누르면 나머진 강의하고 똑같이 나오니 강의 설명으로 참고하시면 돼요

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
  • jetbrain
백성현 댓글 1 좋아요 0 조회수 342

find() 에서 password를 숨길때 사용하는 어노테이션 옵션 차이

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

안녕하세요. 아래 두가지 어노테이션 차이가 궁금합니다. @Column({select: false}) password @Exclude() password 차이가 뭔가요? 둘중 어느것을 써도 find() 에서 password 를 숨겨지는거같은데 용도 차이가 궁금합니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
닥부 댓글 2 좋아요 1 조회수 410

NestJS Mapped types에 관해 궁금한게 있습니다

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

NestJS 공식문서에 강의대로 여러가지 Mapped types들이 있더라고요. https://docs.nestjs.com/openapi/mapped-types#pick 강의에서는 PickType(UsersModel, [ 'nickname', 'email', 'password', ]) { 이렇게 사용 되는데 PickType(CreateCatDto, ['age'] as const) 공식 문서에서는 as const 이게 붙더라고요 무슨 차이가 있는 걸까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 1 좋아요 0 조회수 430

강의를 보고 나니 Restful한 api를 설계 하기 위해선

미해결

[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core

강의를 보고 나니 Restful한 api를 설계 하기 위해선 Profile 에 해당하는 프로퍼티가 name: string; age: number; address: string; 있을때 1. patch [client 요청] { name: 'codefactory', age: 98000, address: '판교' } 프로퍼티를 전체 수정 또는 생성 한다. 해당 resource id값에 해당하는 데이터가 없으면 에러를 던지지 않고 새로 생성한다. 모든 프로퍼티를 기입 해야하고 전체 수정이 발생하거나 새로 생성 된다. 2. patch [client 요청] { name: 'codefactory2', } 수정 하고자 하는 프로퍼티만 기입 해당 resource id값에 해당하는 데이터가 없으면 찾을 수 없다는 error를 던져준다. 제가 이해한것을 정리 해보았고, 궁금한점을 한가지 질문을 적어 보자면 그렇다면 만약, 모든 프로퍼티를 보내지만, 데이터가 없을때 새로 생성하지 않고 에러를 던지는 api가 필요하면 이것은 put인가요 patch 일까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
rhkdtjd_12 댓글 1 좋아요 0 조회수 301

인기 태그

인프런 TOP Writers

주간 인기글