묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지
이미지 부분에 cctv 영상을 넣고 싶은데요.
이미지 부분에 cctv 영상을 구현하고 싶은데, 혹시 .... api를 연동해서 어떻게 연결하면 되는지 알 수 있을까요?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
postgres DB 연결 이슈
계속 postgres 디비 연결하는데 문제가 발생해서요. 해결 방법 알수 있을까요? 다른 비슷한 질문들 보고 port도 변경해 봤는데 [Nest] 4160 - 2023. 12. 12. 오전 10:14:32 ERROR [ExceptionHandler] Entity metadata for UsersModel#postComments was not found. Check if you specified a correct entity object and if it's connected in the connection options. TypeORMError: Entity metadata for UsersModel#postComments was not found. Check if you specified a correct entity object and if it's connected in the connection options. 계속 이렇게 에러가 나서요. 현재 port ‘5433:5432’ 로 연결하고 있습니다.자세한 방법 부탁드립니다.
-
미해결Java 마이크로서비스(MSA) 프로젝트 실습
/actuator/refresh 가 동작하지 않습니다.
안녕하세요~ 강의를 듣다가 제가 뭔가 잘못한건지 actuator에 refresh가 동작하지 않아 질문글을 남깁니다.강의 2-10번 DB 비밀번호 암호화까지 문제 없이 잘 진행하다재가동 없이 설정파일 갱신하는 부분을 진행하는데item-service에서 build.gradle에 의존성 추가하고 bootstrap.yml에 설정 옵션 추가했는데config-server 설정 파일 변경 후 postman 에서 refresh 요청을 날려도 response body 에는 []빈 배열만 찍히고 별다른 문구가 없고 변경된 설정이 적용되지 않더라고요강의를 봐도 크게 설정하는 부분이 많은건 아니어서 잘 적용된 것 같은데 작동하지 않는 원인이 콘솔에 찍히지 않아서 헤메고 있습니다. build.gradle 의존성과 bootstrap.yml 에 설정 추가하고config-server 실행시키고 item-service 실행시킨 후 설정 파일에 변경점을 주고 localhost:5000번으로 /actuator/refresh 요청을 날렸습니다. 그리고 물품등록 요청을 보내서 200코드 성공했는데 별도의 logs 폴더에 api-local2.log는 생기지 않았습니다. 강의와 다르게 한건 인텔리제이로 프로젝트 구성한 것과 스프링부트 마이너 버전만 달라서 크게 문제가 있지는 않을 것 같은데.. 2-10 강의까지 해본 깃 주소도 올려봅니다.https://github.com/doyoun8813/Microservice
-
미해결비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지
노션 링크가 어디있나요 ?
노션 링크가 어디있나요 ? 찾기가 어렵네요..
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
완강이 안됩니다.
모든 강의를 완료하였으나 98.11%에서 올라가지 않습니다.그래서 수료증을 받을 수 없습니다.
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
다중 로그인을 막고 싶다면 추가로 어떻게 구현하는 것이 좋을까요?
안녕하세요!현재 구현된 로직 상에서는 연속으로 여러번 로그인 리퀘스트를 보내더라도 모든 accessToken으로 인증을 통과하는게 가능하던데다중 로그인을 막고 싶은 경우 어떠한 점을 고려하면 좋을 지 강사님께서 추천하시는 방법이 있을까요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
배열
배열 안에 자료형이 여러가지 된 숫자, 문자열 , 볼린 값들을 저장이 가능합니까?
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
delete 로직 문의
POST 맨으로 삭제 요청을 하였을 때 로그를 확인해 보니삭제 요청 아이디로 select를 한번 날리고 아이디가 존재시에만delete 로직이 수행되는데 이는 jpa 내부 프로세스 자체 로직 인가요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
노션 링크 어디에 있나요?
아무리 찾아봐도 링크 주소를 찾지 못해서 링크 주소 올려주시면 감사드립니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
query 없이 mutation 만작성하면 오류가 난다?
안녕하세요~복습중 이상한 현상이 발생하여 질문드립니다~답변 주시면 감사하겠습니다~ 질문1.resolver 부분에서 boards() 부분의 주석 부분을 해제해야, 맨아래 3번 오류가 발생하지 않고, 정상 작동 합니다.Query 없이 Mutation 만작성하면 오류가 발생하는걸까요? 아래 코드와 같이 query 부분을 주석 처리 하면 왜 오류가 나는 걸까요? 질문2.에러가 내가 작성한 파일의 어떤부분이 잘못됐다고,알려주는건 없는 걸까요?아래 에러 코드를 보면 내가 작성한 코드가 아닌작성하지도 않은 설치 파일같은데서 error 정보가 나오는데, 저기를 열어봐야 할까요? GraphQLError: Query root type must be provided. at SchemaValidationContext.reportError (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:73:7) 1.resolverimport { Args, Mutation, Resolver } from '@nestjs/graphql'; import { BoardsService } from './boards.service'; import { CreateBoardInput } from './dto/create-board.input'; import { Board } from './entities/board.entity'; @Resolver() export class BoardsResolver { constructor(private readonly boardsService: BoardsService) {} // @Query(() => String) // boards(): string { // return this.boardsService.boards(); // } @Mutation(() => Board) createBoard( @Args('createBoardInput') createBoardInput: CreateBoardInput, // ): Promise<Board> { return this.boardsService.create({ createBoardInput }); } } 2.serviceimport { Injectable } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { IBoardsServiceCreate } from './interfaces/boards-service.interface'; import { Board } from './entities/board.entity'; @Injectable() export class BoardsService { constructor( @InjectRepository(Board) private readonly boardsRepository: Repository<Board>, // ) {} // boards() { // return 'boards'; // } create({ createBoardInput }: IBoardsServiceCreate): Promise<Board> { return this.boardsRepository.save({ ...createBoardInput }); } } 3.error[ GraphQLError: Query root type must be provided. at SchemaValidationContext.reportError (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:73:7) at validateRootTypes (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:89:13) at validateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\type\validate.js:41:3) at graphqlImpl (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:60:63) at C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:23:43 at new Promise (<anonymous>) at graphql (C:\study\00-codecamp-backend\연습장\memo01\node_modules\graphql\graphql.js:23:10) at GraphQLSchemaFactory.create (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:50:65) at GraphQLSchemaBuilder.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:35:52) at GraphQLSchemaBuilder.build (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:22:31) { path: undefined, locations: undefined, extensions: [Object: null prototype] {} } ] C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:56 throw new schema_generation_error_1.SchemaGenerationError(errors); ^ Error: Schema generation error (code-first approach) at GraphQLSchemaFactory.create (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:56:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at GraphQLSchemaBuilder.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:35:24) at GraphQLSchemaBuilder.build (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql-schema.builder.js:22:20) at GraphQLFactory.generateSchema (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql.factory.js:27:41) at GraphQLModule.onModuleInit (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\graphql\dist\graphql.module.js:109:27) at callModuleInitHook (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\hooks\on-module-init.hook.js:51:9) at NestApplication.callInitHook (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application-context.js:223:13) at NestApplication.init (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application.js:100:9) at NestApplication.listen (C:\study\00-codecamp-backend\연습장\memo01\node_modules\@nestjs\core\nest-application.js:169:33)
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
에러 해결하고 데이터베이스 초기화하기 파트
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.코드팩토리 통합 링크https://links.codefactory.ai안녕하세요 혹시 원래 만든 postModel 인터페이스에서 export interface PostModel { id: number; author: string; title: string; content: string; likeCount: number; commentCount: number;}이렇게 author가 string으로 되어있어서 오류가 나오는데 이건 어떻게 처리하나요? The expected type comes from property 'author' which is declared here on type 'DeepPartial<PostModel>'터미널에서는 이렇게 오류가 나옵니다타입 관련 오류인데 이게 아래에선 postmodel을 받는데 author을 authorId가 들어간 객체로 받는데 위에선 선언을 string으로 해줬는데 이것도 잘 이해가 안 갑니다.. async createPost(authorId: number, title: string, content: string) { // 1) create -> 저장할 객체를 생성한다. // 2) save -> 객체를 저장한다. (create 메서드에서 생성한 객체로) const post = this.postsRepository.create({ author: { id: authorId, }, title, content, likeCount: 0, commentCount: 0, }); const newPost = await this.postsRepository.save(post); return newPost;}
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
관계형 연결되어있는 DB 모델 삭제 시 에러 처리
안녕하세요. 강의 잘 듣고 있습니다.image multer 적용 후, 몇가지 api를 테스트 하던중에 아래와 같은 에러가 발생하여, 해결하고자 시도를 해보았는데 잘 해결 되지 않아 질문 드립니다. 에러 메세지QueryFailedError: update or delete on table "posts_model" violates foreign key constraint "FK_40cd89c6655ec7b102842feacab" on table "image_model"에러 발생 상황- image가 post 모델에 관계형이 지어있는 상황에서, post를 지우려고 하면 (deletePost API 사용) 위와 같은 에러 메세지가 나오며 에러가 발생합니다.에러 해결을 위한 시도- onDelete : "CASCADE" 옵션을 posts model에 주고, db를 초기화 한후 다시 시도해보았지만 같은 상황이 발생하였습니다.해당 에러를 어떤식으로 해결해야할지 말씀 부탁드립니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
예외처리, 함수 Return type 관련하여 질문 드립니다!
안녕하세요!수업 수강 중 궁금한 부분이 생겨 질문 드립니다! 질문 1) Section 11-01 수업 중 users.service.ts 에서 create 함수를 만들 때 const user = await this.findOneByEmail({ email }); if (user) throw new ConflictException('이미 등록된 이메일입니다.');위와 같이 email을 검사하고 이미 이메일이 있으면 예외처리를 해주게 되는데Entity 구현 시 email에 { unique: true } 를 주어도 위 코드처럼 예외처리를 해주어야 하는건가요? 질문 2) Section 10의 products.service.ts 에서 create 함수를 만들 때 함수의 return type은Promise<Product> 로 구현을 했는데,const result2 = this.productsRepository.save({ ...product, productSalesLocation: result, productCategory: { id: productCategoryId, // 만약 name 까지 받고 싶으면? // => createProductInput에 name까지 포함해서 받아오기 }, productTags: tags, }); return result2;이런 식으로 result2 를 return 하게 되면 플레이그라운드에서 return 을 선택할 때 productCategory.name 까지 선택할 수 있게 되어 있더라구요.주석에 쓰여진 내용처럼 name 을 받고 싶으면 createProductInput 에 name을 포함하면 되지만, 지금 처럼 id만 save할 경우, 프론트 개발자 또는 이 API 사용자에게는 productCategory.name이 없다고 매 번 설명을 해야하는 번거로움이 있을 것 같은데 이런 경우 함수의 return type을 새로 정의하기도 하나요?ex) class ProductsServiceCreateReturn ...
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
이미지파일 선 업로드 방식에서 update 로직
강사님 안녕하세요. 파일 업로드 기능 중 선 업로드 방식에서 update로직을 구현하려고 합니다. 한 개의 포스트에 1,2,3 이미지를 인서트해당 포스트에 이미지를 2번 삭제하고 4번 추가 하여 업데이트 이럴 경우, 이미지 테이블을 모두 삭제한 후 1,3,4 이미지 파일명을 이미지 테이블에 넣어주면 될까요?1,3 이미지는 public/post 경로에 이미 있고 3이미지는 temp 경로에 있을텐데 public폴더와 temp 폴더를 모두 access 해봐서 temp에 있는 경우만 이미지 파일위치를 옮겨주면 될지 Update를 어떻게 구현하면 좋을지.,문의드립니다. 좋은강의 정말 감사합니다!
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
마지막 1분 코스가 완료가 안되서, 완강처리가 안됩니다.
마지막 1분 코스가 완료가 안되서, 완강처리가 안됩니다.그래서 수료증을 받을 수가 없습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
yarn add @apollo-server 405 에러...
설치하려하는데 405 에러 나오네요....검색해서 나오는것도 몇가지 해보긴했는데...해결이 안되서 올려봅니다~## 에러메시지Error: https://registry.npmjs.org/@apollo-server: Request "https://registry.npmjs.org/@apollo-server" returned a 405
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
HATEOAS 3단계 적용 질문입니다 !
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-hateoas</artifactId> </dependency>섹션 4 Level3 단계의 REST API 구현을 위한 HATEOAS 적용에서 오류가 발생했습니다.retrieveAllUsers@GetMapping("/users") public List<User> retrieveAllUsers() { return service.findAll(); }전체 조회 메서드는 잘 작동이 되는데retrieveUser @GetMapping("/users/{id}") public EntityModel<User> retrieveUser(@PathVariable int id) { User user = service.findOne(id); if (user == null){ throw new UserNotFoundException(String.format("ID[%s] not found", id)); } EntityModel<User> entityModel = EntityModel.of(user); WebMvcLinkBuilder linkTo = linkTo(methodOn(this.getClass()).retrieveAllUsers()); entityModel.add(linkTo.withRel("all-users")); return entityModel; }이런 오류가 발생했습니다.어떻게 해결해야 할까요?
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
post 업데이트 코드 이렇게 작성해도 되나요?
async patchPost(id: number, title: string, content: string, author: string) { const post = await this.postsRepository.save({ id, title, content, author, }); if (!post) { throw new NotFoundException(); } return post; }
-
미해결비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지
axios 이후 마커 오류
axios로 dataSet을 받아오는 과정에서 undefined오류가 뜨는데 무엇이 문제인가요? 사진은 개발자도구에서 콘솔창에 뜨는 오류랑오류가 발생했다고 하는 98줄의 코드입니다
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
Github
터미널에 'git push origin master'를 입력하고 엔터를 누르면fatal: 'origin' does not appear to be a git repositoryfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists. 이렇게 나와고 있어요. 어디서 실수했어요?