inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

posts 테이블에 authorId 컬럼값의 이름은 자동으로 생성되는건가요?

미해결

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

항상 좋은 강의 감사합니다. 강의를 들으며 궁금했던 부분은 제가 따로 테이블 컬럼이름을 설정해준 적이 없는데 자동으로 columnId 값으로 지정된 부분입니다. 현재 제 추측으로는 async createPost(authorId: number, title: string, content: string) { const post = this.postsRepository.create({ author: { id: authorId, }, title, content, likeCount: 0, commentCount: 0, }); const newPost = await this.postsRepository.save(post); return newPost; } 해당 부분에서 create의인자로 받는 author 부분에서 key 값인 id를 확인해서 자동적으로 authorId 라는 값이 만들어진건가 추측해보고 있는데 혹시 제 추측이 맞을까요?

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

findAndCount 함수에서 왜 count가 0이 아닌 값들은 제외 되었는지 궁금합니다.

미해결

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

const userAndCount = await this.userRepository.findAndCount({ take: 3, }); 위 와 같은 코드에서 결과 값으로 count가 변경 되어 있는 id 1,3의 값은 왜 가져오지 않았는지 궁금합니다!

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

relation option "nullable : false" 로 설정했는데, 테이블에 insert가 되고 있습니다.

미해결

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

안녕하세요 선생님~ 위와 같이 세팅해서 user/profile 로 post 요청을 보내면 500 에러가 나야하는걸로 알고 있는데, 이처럼 잘 들어가 버리네요ㅜ `users` 로 get요청을 보내도 profile이 null이 들어간 상태로 조회됩니다. 개발환경 버전도 올려드립니다~

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
노상 댓글 3 좋아요 0 조회수 420

docker-compose yaml 파일 깃 업로드

미해결

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

안녕하세요 코팩님 nestjs/config 모듈과 process.env 를 이용해서 환경변수 파일을 작성하고 환경변수를 불러오고 하잖아요. 그런데 docker-compose.yaml 파일에도 db password나 이런게 존재하는데, docker-compose 파일은 깃허브에 보통 포함을 안 하나요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
정민교 댓글 1 좋아요 0 조회수 310

DTO 폴더는 BusinessLayer로 옮겼는데, using문은 HelloASP로 계속하나요?

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

혹시나해서 LoginService 클래스에서 using BusinessLayer.DTO 추가했는데도 인식을 못하네여.. 또한 ILoginService도 인식을 못하던데, 중간에 누겟설치와 참조 관계 때문에 그런건지? 여쭤봅니다. 수정) 다시보니, DTO 클래스에서 네임스페이스 바꾸지 않아서 인식을 못했던거네여.... 강의에서 네임스페이스를 안바꾼 이유가 있나요?

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
kbj0619 댓글 1 좋아요 0 조회수 289

spring boot 3.0 이후 handleMethodArgumentNotValid 메소드

미해결

[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발

안녕하세요 강사님 좋은 강의 감사드립니다. 스프링부트 3.0 이후부터는 오버라이딩한 handleMethodArgumentNotValid 메소드를 타지 않아 강의에서처럼 동작을 하지 않습니다. 다음과 같이 코드를 짜도 에러가 나면서 서버가 죽어버리는데 어떻게 해야 되나요? @ExceptionHandler(BindException.class) public final ResponseEntity<Object> handleMethodArgumentNotValidException(BindException ex) { ExceptionResponse exceptionResponse = new ExceptionResponse(LocalDateTime.now(), ex.getMessage() , ex.getBindingResult().toString()); // 클라이언트에게 상세정보 안보여주도록 false return new ResponseEntity<>(exceptionResponse, HttpStatus.NOT_FOUND); } 에러 내용 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerExceptionResolver]: Factory method 'handlerExceptionResolver' threw exception with message: Ambiguous @ExceptionHandler method mapped for [class org.springframework.validation.BindException]: {public final org.springframework.http.ResponseEntity com.example.myrestfulservice.exception.CustomizedResponseEntityExceptionHandler.handleMethodArgumentNotValidException(org.springframework.validation.BindException), public final org.springframework.http.ResponseEntity org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler.handleException(java.lang.Exception,org.springframework.web.context.request.WebRequest) throws java.lang.Exception} at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644) ~[spring-beans-6.1.5.jar:6.1.5] ... 24 common frames omitted Caused by: java.lang.IllegalStateException: Ambiguous @ExceptionHandler method mapped for [class org.springframework.validation.BindException]: {public final org.springframework.http.ResponseEntity com.example.myrestfulservice.exception.CustomizedResponseEntityExceptionHandler.handleMethodArgumentNotValidException(org.springframework.validation.BindException), public final org.springframework.http.ResponseEntity org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler.handleException(java.lang.Exception,org.springframework.web.context.request.WebRequest) throws java.lang.Exception} at org.springframework.web.method.annotation.ExceptionHandlerMethodResolver.addExceptionMapping(ExceptionHandlerMethodResolver.java:114) ~[spring-web-6.1.5.jar:6.1.5] at org.springframework.web.method.annotation.ExceptionHandlerMethodResolver.<init>(ExceptionHandlerMethodResolver.java:78) ~[spring-web-6.1.5.jar:6.1.5] at org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.initExceptionHandlerAdviceCache(ExceptionHandlerExceptionResolver.java:289) ~[spring-webmvc-6.1.5.jar:6.1.5] at org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.afterPropertiesSet(ExceptionHandlerExceptionResolver.java:256) ~[spring-webmvc-6.1.5.jar:6.1.5] at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers(WebMvcConfigurationSupport.java:1063) ~[spring-webmvc-6.1.5.jar:6.1.5] at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.handlerExceptionResolver(WebMvcConfigurationSupport.java:1005) ~[spring-webmvc-6.1.5.jar:6.1.5] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.5.jar:6.1.5] ... 25 common frames omitted

  • rest-api
  • spring-boot
chaelynjang 댓글 2 좋아요 0 조회수 1066

findOne 사용 이유

해결됨

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

강의 8:23에 createChat 함수의 리턴값으로 save 함수에서 반환된 chat을 사용하지 않고 findOne 함수를 통해 조회한 chat을 사용하신 이유가 궁금합니다!

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
홍석주 댓글 1 좋아요 0 조회수 211

css 적용 중 강의대로 적용되지 않아 질문 드립니다

미해결

비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지

맛집 지도 뼈대 잡고 반응형 처리하기 -> 파트를 들으며 수강 중이었는데요, 버튼들이 이렇게 4,4개로 정렬되지 않아서 질문 드립니다. width: 25% 를 했을 땐 위와 같이 정렬되고 (모든 너비에서 똑같습니다) 24%를 하면 4개 4개로 되긴 하는데 너무 찝찝해서요.. 분명 똑같이 따라 친 것 같은데 강의를 다시 돌려보아도 찾기가 힘드네요.. 아래에 제 css와 html 코드를 올려두겠습니다 ㅠㅠ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>맛집지도</title> <meta name="author" content="동네코딩" /> <meta name="description" content="맛집지도 서비스" /> <meta name="keywords" content="동네코딩, 맛집지도, 유튜버맛집, 맛집유튜버" /> <link rel="stylesheet" href="style.css" /> </head> <body> <nav> <div class="inner"> <div class="nav-container"> <h1 class="nav-title">맛집지도</h1> <button class="nav-contact">Contact</button> </div> </div> </nav> <main> <section id="category"> <div class="inner"> <div class="category-container"> <h2 class="category-title">맛집지도 카테고리를 선택해보세요</h2> <div class="category-list"> <button class="category-item">한식</button> <button class="category-item">중식</button> <button class="category-item">일식</button> <button class="category-item">양식</button> <button class="category-item">분식</button> <button class="category-item">구이</button> <button class="category-item">회/초밥</button> <button class="category-item">기타</button> </div> </div> <!-- 카테고리 --> </div> </section> <div id="map"> <!-- 카카오지도 --> </div> </main> </body> </html> @font-face { font-family: "KyoboHandwriting2020A"; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2112@1.0/KyoboHandwriting2020A.woff") format("woff"); font-weight: normal; font-style: normal; } * { padding: 0; margin: 0; box-sizing: border-box; } html { font-size: 10px; font-family: "KyoboHandwriting2020A"; } nav { background-color: rgb(212, 210, 210); } .nav-container { padding: 1rem 0; display: flex; flex-direction: row; /* row로 결정되어있는데 가시적으로 적어줌 */ justify-content: space-between; align-items: center; } .nav-title { font-size: 3rem; } .nav-contact { font-size: 2.5rem; border: 0; background: none; cursor: pointer; font-family: inherit; } .category-title { font-size: 3.5rem; } .category-item { width: 25%; height: 5rem; background:none; border:none; font-family: inherit; font-size: 1.6rem; } .inner { padding: 0 1.5rem; } @media all and (min-width: 1024px) { .inner { max-width: 1024px; margin: 0 auto; } }

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
ryucream612 댓글 2 좋아요 0 조회수 379

SQL Server Management 연결 불가

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

서버 이름이 아래와 같이 공란으로 보이며, MSSQLSERVER 로 입력 시 아래 오류창이 뜹니다

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
괄호쓰다손목삠 댓글 1 좋아요 0 조회수 273

Razor View 추가시 NuGet 자격증명 무한루프

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

6:10 에서 진행되는 View 리턴값에 Razor 뷰 추가시 NuGet 자격증명 하라는 MS로그인팝업이 뜹니다. 로그인시 스캐폴딩 진행 조금 하다가 다시 뜨고 무한반복이네요. 창을 닫고 실행해보니, 위와같은 에러창이 뜹니다.

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
괄호쓰다손목삠 댓글 1 좋아요 0 조회수 195

섹션26 FileIntercepter적용문의

미해결

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

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

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
김경민 댓글 2 좋아요 0 조회수 260

섹션26 FileIntercepter적용 질의

미해결

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

분명 postman으로 FormData로 설정하신후title,content,image를 보내셨는데 어떻게Nestjs에서 @Body()로 받을수 있나요 Http요청이니 req.body 형식으로 접근 가능한게 아닐까요??

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
김경민 댓글 2 좋아요 0 조회수 235

configService와 process.env

미해결

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

안녕하세요 코팩님! class 작성 시에 다른 class를 상속하여 작성하는 경우 있잖아요 nestjs/passport를 이용해서 구글 oauth 로그인을 구현하려고 합니다. import { PassportStrategy } from '@nestjs/passport'; import { Strategy } from 'passport-google-oauth20'; import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; @Injectable() export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { constructor(private readonly configService: ConfigService) { super({ clientID: this.configService.get('GOOGLE_CLIENT_ID'), clientSecret: this.configService.get('GOOGLE_CLIENT_SECRET'), callbackURL: 'http://localhost:3000/auth/google/callback', scope: ['email', 'profile'], }); } 이 경우에 super() 호출 전에 this 를 참조하려고 해서 에러가 발생합니다. 이런 경우에는 불가피하게 그냥 @Injectable() export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { constructor() { super({ clientID: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, callbackURL: 'http://localhost:3000/auth/google/callback', scope: ['email', 'profile'], }); } 이렇게 직접 환경변수를 적어주는 방법 밖에는 없을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
정민교 댓글 1 좋아요 0 조회수 297

혹시 DTO에 대해서 설명해 주실수 있나요?

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

DTO라는 개념이 이후 강의에서도 계속 나오는데, 개념 설명이나 이걸 왜 쓰는지에 대해 자세히 나온게 없는거 같아서 질문드립니다. (물론 제가 못 찾은 거 일수 있습니다. 만약 강의에 있다면 어디쯤에 나오는지만 알려주시면 제가 참고해서 보겠습니다.) 그리고 endpoint(끝점?) 이것도 모르겠습니다... 개념 설명좀 부탁드립니다.

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
kbj0619 댓글 3 좋아요 0 조회수 413

직접 생성하지 않은 주소가 생성되어 있습니다.

미해결

[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발

이 사진처럼 "/jpa/users/{id}/posts" 가 아닌 "/users/{id}/posts" 로도 접속이 됩니다. 또, "localhost:8088/posts/{postId}" 도 생성되어 있던데 이런 것들은 어떤 과정으로 생성된 것인가요?

  • rest-api
  • spring-boot
D SD 댓글 2 좋아요 0 조회수 218

14분 20초쯤에 쿼리 새로 만드신거 여쭤봅니다.

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

새 쿼리 만들어서도 가능하지만, sqlhelper 파일로 데이터베이스 연결이 가능하다는 걸 보여줄려고 그냥 한번 보여주신건가요?

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
kbj0619 댓글 1 좋아요 0 조회수 191

마스터 페이지를 쓸려면 폴더 이름을 꼭 Shared로 해야하나요?

미해결

ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0

위에 Home 폴더와 Test뷰는 컨트롤러와 액션 때문에 이름을 딱 맞춰서 한걸로 아는데 Shared폴더와 _Layout 파일은 따로 언급이 없으셔서 여쭤봅니다.

  • C#
  • mvc
  • rest-api
  • 아키텍처
  • mssql
  • ef-core
  • asp.net-core
kbj0619 댓글 1 좋아요 0 조회수 214

섹션 6에서 코드를 서비스 단으로 옮기고 난뒤부터 get 메소드가 제대로 작동하지 않아요

미해결

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

강의를 따라서 로직을 서비스 단으로 옮긴 뒤부터 response 코드 200인데 내용이 posts들이 오지 않아요getPosts byId도 이렇게 되고 getAllPosts도 이렇게 됩니다 도와주세요 ㅠㅠ 나머지 put이랑 post , delete 는 제대로 작동합니다 ㅠㅠ

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

인기 태그

인프런 TOP Writers

주간 인기글