inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

데코레이터가 잘 이해가 안갑니다.

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

@Field 하면 어떠한 객체에 있는것에 있는 Field 를 가져다 쓸거야~ 라고 말하면서 그러한 함수를 불러오는 건가요?? ㄷ

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
leejken530 댓글 1 좋아요 0 조회수 279

웹에서 포스트 맨 사용하면 파일업로드가 불가능합니다.

미해결

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

아무리 찾아봐도 웹에서 해결하는 것이 불가능해서 postman desktop 까는 것을 추천드립니다 ㅎㅎ

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
진수하 댓글 1 좋아요 0 조회수 375

gateway level에서 filter도 잘 작동합니다!

미해결

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

@UsePipes( new ValidationPipe({ transform: true, transformOptions: { enableImplicitConversion: true, }, whitelist: true, forbidNonWhitelisted: true, }), ) @UseFilters(SocketCatchHttpExceptionFilter) @WebSocketGateway({ // ws://localhost:3000/chats namespace: 'chats', }) export class ChatsGateway implements OnGatewayConnection { constructor( private readonly chatsService: ChatsService, private readonly messagesService: ChatsMessagesService, ) {} ... } 각각의 메소드마다 넣어주는것보다 나은것 같아서 공유 해보아요!

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

ValidationPipe를 좀 더 편하게 쓸 수 없을까해서 찾아보니 controller에서 사용 할 수 있더라고요

미해결

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

https://docs.nestjs.com/faq/request-lifecycle 공식 문서에 보니까 controller level에서 사용 할 수 있는것 같아서 controller와 gateway가 비슷하니까 사용 가능하지 않을까 해서 테스트 해보니까 @UsePipes( new ValidationPipe({ transform: true, transformOptions: { enableImplicitConversion: true, }, whitelist: true, forbidNonWhitelisted: true, }), ) @WebSocketGateway({ // ws://localhost:3000/chats namespace: 'chats', }) export class ChatsGateway implements OnGatewayConnection { ... } 해당 gateway에서 usePipes를 설정 할 수 있더라고요! 차선책으로 이것도 괜찮은것 같아서 공유 해봅니다!

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

19:55초정도에 3명의 사용자중 메세지를 보낼려는 사용자가 "enter_room"에 메세지를 보내는데

미해결

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

아마 강사님 실수인듯합니다. User 1이 enter_room에 2번 채팅방에 참여 한다고 메세지를 보내는데 "enter_chat"이 맞습니다! 제가 실험 해보니까 결국 enter_chat을 제대로 하지 않은 경우에 다른 사용자가 보낸 message를 제대로 리시브 받지 못하더라고요.

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

쿼리러너관련질문

미해결

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

안녕하세요 쿼리러너 관련 질문드립니다 코멘트 생성시 Pid 에 일부러 엉뚱한 값을 넣는 경우 QueryRunner를 쓰고 안쓰고에 차이가 있더라구요. 예를들어 this.commentService.ceateComment(dto, pId, user, qr); qr repository 를 일부러 사용하지 않게 조작하면 pid 에 이상한 값을 넣어도 valitation 없이 create 가 되었는데 Qr 을 넘겨주는 순간 아래와 같이 유효하지 않은 pk 에 대해 조작하려고 한다는 validation 을 해주더라구요. { "path": "/posts/{엉뚱한 값}/comments", "statusCode": 500, "message": "insert or update on table \"comment\" violates foreign key constraint \"FK_94a85bb16d24033a2afdd5df060\"", "timestamp": "1/21/2024, 4:06:08 PM" } 이런 차이는 어디서 나는것일지, 이런것들도 Query Runner 의 역할인지도 궁금합니다.

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

정규화 엑셀자료

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요, 09-데이터 정규화 1에서 구글 시트를 사용하시는데 이 주소 어디서 접속 가능할까요?

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
SW 댓글 2 좋아요 0 조회수 228

파이널 과제 css,html질문입니다.

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

가입하기 버튼 누르면 에레메세지 출력하게 할때 저는 wrapper바깥으로 내용이 빠져 나가는데 어떻게 해야 wrapper크기도 같이 늘어나게 하는건가요?

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
빵빵 댓글 1 좋아요 0 조회수 215

mongoDB접속 관련 문의

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

04-05 ODM - mongoDB접속 강의에서 docker-compose build했을 때 > [mybackend 5/6] RUN yarn install: 0.132 yarn install v1.22.19 0.150 [1/4] Resolving packages... 0.176 [2/4] Fetching packages... 3.678 error mongoose@8.1.0: The engine "node" is incompatible with this module. Expected version ">=16.20.1". Got "14.21.3" 3.678 error Found incompatible module. 3.678 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ------ failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1 위와 같이 오류가 떠요. node버전이 mongoose버전과 맞지 않다고 하는데 기존 node를 삭제하고 오류에서 말한 16.20.1버전으로 새로 설치해야하는 건가요? 재 설치하면 기존에 학습했던 코드들에 영향을 받진 않나요?

  • javascript
  • node.js
  • docker
  • rest-api
  • nestjs
장주윤 댓글 2 좋아요 0 조회수 309

length에서 min값만 설정하고 싶을 때 max 없이 validationOptions을 어떻게 전달할 수 있나요..?

미해결

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

length에서 max값을 전달 안해주고 min만 설정하고 싶을때 if(args.constraints.length===2){ } else}{ } 여기서 else 가 실행되어야 하는데 max 값 없이 validationOptions만을 전달하면 validationOptions가 두번째 인자로 전달되는 것 아닌가요..? 이렇게 하면 에러 나는데.. max 값에 undefined나 null을 넣어도 안되는 것 같습니다. 어떻게 max 값 없이 validationOptions를 실행할 수 있나요..?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
purnsup90 댓글 2 좋아요 0 조회수 353

모델명을 복수로 하는 이유가 따로 있을까요?

미해결

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

안녕하세요. 강의내용과는 상관없는 뜬금 질문인데, 모델의 엔티티파일, api path 명 등등에 단어들을 대부분 복수로 표기하시는 이유가 따로 있는지 궁금합니다. MessageModels vs MessagesModel ? /users/:id vs user/:id ?

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

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 조회수 392

피미 인디언 당뇨병 예측 관련 질문

해결됨

[개정판] 파이썬 머신러닝 완벽 가이드

교수님 안녕하십니까 교수님의 수업을 정말 즐기면서 듣고있는 AI빅데이터 전공 대학생입니다. 교수님의 강의 피마 인디언 당뇨병 예측 편을 보고 여태 배운 것을 백분 활용하여 제 방식대로 따로 모델을 구현을 해보았는데요. 먼저 임신횟수와 Outcome을 제외한 나머지 column들에 있는 0 값들은 모두 결측치로 판단하고 평균 값으로 대체하였습니다. RandomForestClassifier 알고리즘을 사용하고 GridSearchCV 함수를 통해 best estimator를 추출였습니다. 정밀도와 재현율이 동시에 높으면 좋지만 재현율이 증가하면 정밀도가 하락하는 현상(trade-off) 때문에 둘 중 하나를 선택해야 했고 이 피마 인디언 당뇨병 데이터 셋 같은 경우 병의 발견 목적으로 모델을 제작한다고 했을 때 실제로 당뇨병인데 모델이 당뇨병이 아니라고 예측하는 것이 치명적이라고 생각하여 정밀도 보다는 재현율을 중점적으로 보았습니다. 그리하여 precision_recall_curve 함수를 통해 최적의 재현율과 F1_score얻은 threshold 값을 추출하였습니다. 제가 얻은 값은 오차 행렬 [[72 28] [ 4 50]] 정확도: 79.22% , 정밀도: 64.10% , 재현율 92.59%, F1_Score: 75.76% 임계값: 0.32212471005503873 입니다. 오차 행렬을 보았을때도 한쪽에 치우쳐있는 불균형도 없다고 판단하였고 정밀도와 재현율 f1_score도 괜찮게 나왔다고 판단했습니다. 임계값을 0.32212471005503873로 주었을 때 roc_auc_score는 0.82296이라는 1에 꽤나 근접한 수치를 얻었습니다. 질문1: 이런식으로 모델을 찾아가는 방식이 옳은 방식인지 궁금합니다. 질문2: 제가 선택한 모델을 사용한다고 한다면 매번 RandomClassifier로 fit한 model을 Binarizer을 통해서 threshold 값을 매번 지정해주어야 하는건가요? 애초에 처음 모델을 fit할 때 임계값을 제가 부여는 못하는 것일가요?

  • python
  • 머신러닝
  • 통계
신봉균 댓글 1 좋아요 1 조회수 365

nestjs typeorm 에서 mariadb 고가용성 galera cluster 적용 관련

미해결

탄탄한 백엔드 NestJS, 기초부터 심화까지

nestjs 좋은 강의 잘 들었습니다.~ 감사합니다. 다만 질문이 있습니다. 기존코드를 nestjs로 마이그레이션 하고 있습니다. mariadb 고가용성 적용을 해야됩니다. 구글링을 해도 해당 관련한 자료가 별로 없어서 질문드립니다. typeorm type을 보면 replication으론 mater, salves 필드로 고가용성이 지원되는데 cluster 구조로 지원이 되는게 맞는지 알고 싶습니다. 아직 응용은 못하는 단계라서 질문 드립니다. 만약 typeorm에서 cluster 지원이 되지 않는다면 어떤 방법으로 할 수 있나요?

  • node.js
  • express
  • nestjs
  • cluster
  • mariadb
  • galera
  • typeorm
윤재진 댓글 1 좋아요 0 조회수 406

502 Bad Gateway

해결됨

작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지

2024/01/15 15:08:24 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.64.1, server: , request: "GET / HTTP/1.1", upstream: "http://172.18.0.2:8000/", host: "192.168.64.7" 위와 같은 오류가 발생하는데 문제가 무엇인지 모르겠습니다.

  • python
  • django
  • docker
댓글 0 좋아요 0 조회수 490

빌드 후 /dist 디렉토리가 강사님과 다른데 괜찮을까요

해결됨

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

npm run build 후 npm run start:prod 했더니 main.js를 찾을 수 없다는 에러 메세지가 나와 디렉토리를 확인해보니 아래와 같았습니다. 그리고 main.js는 /dist/src 아래에 있었고요. 일단 packakge.json에서 start:prod의 실행 경로를 'dist/src/main.js'로 변경했고, npm run start:prod해서 서비스 가동되는것 확인했습니다. vsc 종료해도 로컬 호스트로 백엔드 서버 접근과 api 사용까지 이상 없이 되는 것 확인했으니 이대로 aws에 올리고 루트 디렉토리에 /dist 폴더, .env, .gitignore, package-lock.json, package.json만 업로드 해주면 되는걸까요?

  • node.js
  • express
  • nestjs
  • typeorm
jeongho218 댓글 1 좋아요 0 조회수 277

mariadb 접근권한 오류

해결됨

작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지

File "/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py", line 193, in init super().__init__(*args, **kwargs2) django.db.utils.OperationalError: (1044, "Access denied for user 'django'@'%' to database 'django'") mariadb 컨테이너를 실행 후, django 컨테이너를 실행 시 위와 같은 오류가 발생합니다. 찾아보니 django 에 대한 권한이 없어서 그렇다고 하는데, 해결방법이 있을까요?

  • python
  • django
  • docker
댓글 1 좋아요 0 조회수 564

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

미해결

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

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

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

5장 회귀 실습 2:캐글경연 주택가격 예측-Advanced Regression Techniques - 01 질문 있습니다😊

미해결

[개정판] 파이썬 머신러닝 완벽 가이드

선생님 안녕하세요! 5장 회귀 실습 2:캐글경연 주택가격 예측-Advanced Regression Techniques - 01 을 듣다가 타겟 값인 Price를 로그 변환하여 정규 분포 형태로 변환하고, 피처들 중 숫자형 컬럼의 Null 값 데이터 처리 부분 코드를 다음과 같이 썼습니다. 그런데 결과가 사진과 같이 float64가 포함된 형태로 나왔습니다. 제가 어떤 부분에서 잘못한 건지, 그리고 어떻게 해야 선생님과 같은 결과가 나올 수 있나요?ㅎㅎ # SalePrice 로그 변환 original_SalePrice = house_df['SalePrice'] house_df['SalePrice'] = np.log1p(house_df['SalePrice']) # Null이 너무 많은 컬럼들과 불필요한 컬럼 삭제 house_df.drop(['Id', 'PoolQC', 'MiscFeature', 'Alley', 'Fence', 'FireplaceQu'], axis=1, inplace=True) # Drop하지 않는 숫자형 Null 컬럼들은 평균 값으로 대체 num_columns = house_df.dtypes[house_df.dtypes !='object'].index.to_list() house_df[num_columns].fillna(house_df[num_columns].mean(), inplace=True) # Null 값이 있는 피처명과 타입을 추출 null_column_count = house_df.isnull().sum()[house_df.isnull().sum() > 0] print('## Null 피처의 Type :\n', house_df.dtypes[null_column_count.index])

  • python
  • 머신러닝
  • 통계
곽민선 댓글 1 좋아요 0 조회수 240

경로 관련 궁금증

미해결

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

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

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

인기 태그

인프런 TOP Writers

주간 인기글