inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

헤티오스 빈 문제

미해결

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

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed 현재 스프링부트 2.7.9쓰고있고 어떻게 해결해야할까요

  • rest-api
  • spring-boot
(디지털콘텐츠·가상현실트랙)김상원 댓글 1 좋아요 0 조회수 658

bcrypt를 설치하니까 docker 컨테이너가 실행이 안되네요ㅠ

해결됨

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

검색을 나름대로 열심히 해봤는데 잘 해결이 되지 않아서 질문 남깁니다. error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid elf header 에러 메시지는 이렇습니다. bcrypt가 설치되는 OS에 따라 버전이 달라서 그렇다는거 같은데, Dockerfile에 bcrypt 삭제했다가 설치하는 명령어도 넣어봤는데 잘 안되네요ㅠ

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
songin cheon 댓글 1 좋아요 0 조회수 877

session.abortTransaction()에 대한 실제 예시 문의

해결됨

mongoDB 기초부터 실무까지(feat. Node.js)

아래 명령어를 통해 transaction이 실패했을 때 원복한다고 하는데, 저런 것은 catch문에 넣어야 하는 것이 맞나요? 아니면 if else로 문제점을 발견했을 때 처리하게 하는 걸까요? 즉, 저 코드를 실제로 사용할 때, 어떤 모습으로 들어가는 지 궁금합니다. session.abortTransaction()

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
띵동 댓글 1 좋아요 0 조회수 313

[ODM-MongoDB접속] post요청 후 몽고DB에서 조회가 안됩니다.

해결됨

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

postman에서 post요청 후 get으로 확인했을 때 잘 받아와집니다. MongoDB Compass에 localhost :27017로 연결해서 refresh해도 mydocker DB가 조회가 안됩니다. docker - mongodb가 연결이 잘 안된건지 어렵습니다.. 어떻게 확인할 수 있을까요? import express from 'express' import { checkValidationPhone, getToken, sendTokenToSMS } from './phone.js'; import swaggerUi from 'swagger-ui-express' import swaggerJSDoc from 'swagger-jsdoc' import { options } from './swagger/config.js' import cors from 'cors' import { checkValidationEmail, getWelcomeTemplate, sendWelcomeTemplateToEmail } from './email.js'; import mongoose from 'mongoose' import { Board } from './models/board.model.js' const app = express() app.use(cors()) app.use(express.json()); app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerJSDoc(options))); app.get('/boards', async (req, res) => { // const result = [ // { // number: 1, // writer: '철수', // title: '제목입니다~~~', // contents: '내용이에요@@@', // }, // { // number: 2, // writer: '영희', // title: '영희 제목입니다~~~', // contents: '영희 내용이에요@@@', // }, // { // number: 3, // writer: '훈이', // title: '훈이 제목입니다~~~', // contents: '훈이 내용이에요@@@' // }, // ]; const result = await Board.find() //DB접속해서 가져오는 내용 위랑동일 res.send(result) }) app.post('/boards', async (req, res) => { console.log(req.body); // 1. 데이터를 등록하는 로직 => DB에 접속해서 데이터 저장하기 const board = new Board({ writer: req.body.writer, title: req.body.title, contents: req.body.contents, }); await board.save(); //원래는 SQL문법을 써야하지만 mongoose가 자동으로 변환해줌.(ORM, ODM) // 2. 저장 결과 응답 주기 res.send("게시물 등록에 성공하였습니다."); }); app.post('/tokens/phone', (req, res) => { const myphone = req.body.myphone; const isValid = checkValidationPhone(myphone); if (isValid) { const mytoken = getToken(); sendTokenToSMS(myphone, mytoken); res.send('인증완료!!!'); } }); app.post("/users", (req, res) => { const user = req.body.myuser const isValid = checkValidationEmail(user.email) if(isValid){ const mytemplate = getWelcomeTemplate(user) sendWelcomeTemplateToEmail(user.email, mytemplate) res.send("가입완료!") } }) //몽고DB 접속 mongoose.connect("mongodb://my-database:27017/mydocker") // localhost로 접속하게되면 express 도커안에서의 localhost이기때문에 dockercompose로 묶인 my-database-1 컴퓨터로 들어가야함. // 단, dockercompose로 묶어뒀기 때문에 이름만 입력해서 진입가능(네임리졸루션). // Backend API 서버 오픈 app.listen(3000, () => console.log(`exemple app listening on port ${3000}`))

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
치카치카 댓글 1 좋아요 0 조회수 833

ResponseEntity created

미해결

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

return ResponseEntity.created(URI.create("/Member/"+id)).build(); 이렇게 코드 이동을 시켰느데 Header에 Location의 경로에는 이동하고 싶은 URI가 있지만 화면은 빈 화면을 보여줍니다. 어떻게 이동할 수 있나요?? 선생님께서 작성하신대로해도 Header의 Location의 경로은 저렇게 있지만 실행하면 빈 화면만나옵니다. 원하는 메시지와 함께 이동을 원할 시 어떻게 해야 할까요?

  • rest-api
  • spring-boot
kim1234123 댓글 1 좋아요 0 조회수 2259

라우터 클래스 질문입니다

미해결

테스트주도개발(TDD)로 만드는 NodeJS API 서버

var user = require("./api/user"); app.use("/user", user); app.listen(3000, function () { console.log("Example app listening on port 3000"); }); module.exports = app; app.use("/user", user) 이렇게 하면 ./api/user/index.js파일에서 export한 router객체를 자동으로 참조하게 되는건가요? app.use("/user", router) 라고 해야 이해가 될거 같은데...express 문법을 몰라서 질문 올렸습니다

  • node.js
  • express
  • tdd
  • rest-api
가보자!! 댓글 1 좋아요 0 조회수 468

섹션9 Computed Fields 강의에서, 다음 강의 가기 전 빠진부분

미해결

mongoDB 기초부터 실무까지(feat. Node.js)

이거 지워줘야합니다. 안그러면 /:blgoId get 요청 할 때, "error": "commentCount is not defined" 에러 나옵니다. 또, 여기 주석처리 풀어줘야합니다. 안그러면 다음강의에서, comment Post 할 때 "Cannot read properties of undefined (reading 'push')" 에러나요. 수업에서는 이부분에대한 조작없이 이미 되어있는 상태로 진행되고 나오지 않습니다. 다른 분들은 이거 다 알아서 해결하고, 수업진행하신건가;; 에러나서 진행이 안될텐데;; 게시판에 질문들이 없네요. ㅡㅡ;

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
viewee 댓글 1 좋아요 -1 조회수 426

하나의 컨테이너에 api서버와 데이터서버를 같이 관리할 수 있나요?

해결됨

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

강의에서는 api서버와 데이터베이스 서버를 각각의 컨테이너에서 관리하는걸 보여주셨는데 하나의 api서버와 데이터베이스서버를 같이 넣는것도 가능한지 궁금합니다.

  • express
  • docker
  • rest-api
cckdals111 댓글 1 좋아요 1 조회수 547

몽고디비 접속 문제

해결됨

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

노션에 써있는걸로 sudo systemctl start mongod 실행하면 실행이 안되서 공식문서에서 찾아보니 sudo service mongod start 를 입력하면 starting database mongod 라고 뜬 후 fail이 뜹니다.... localhost:27017 로 접속을 하면 잘 뜨긴 하는데 해결 방법이 없을까요 ??

  • javascript
  • node.js
  • express
  • tdd
  • rest-api
  • nestjs
  • mongod
  • mongodb
cgc 댓글 1 좋아요 0 조회수 612

[flask 로 Rest API 구현과 테스트] 질문있습니다

미해결

[리뉴얼] 처음하는 파이썬 백엔드와 웹기술 입문 (파이썬 중급, flask[플라스크] 로 이해하는 백엔드 및 웹기술 기본) [풀스택 Part1-1]

현재 해당 수업을 너무 잘 듣고 있는 수강자입니다~ 이런 강의 제공해주셔서 감사드립니다. 제가 이 강의를 듣게된 이유는 머신러닝 모델을 통해서 모델을 배포하고 결과를 고객에게 보여주기위해 Flask를 사용해보려고 하기 때문인데요.. 아직 지식이 짧아서 그런지, REST API 구현시 ML모델 결과가 만약 Table로 나온다면 이 역시도 JSON 파일로 response를 해줄수가 있는걸까요? 답변 기다리고 있겠습니다.

  • python
  • rest-api
  • flask
A+Plus 댓글 1 좋아요 1 조회수 987

faker 패키지 취약성 이슈

미해결

mongoDB 기초부터 실무까지(feat. Node.js)

faker 패키지 이슈가 생겼습니다. npm i faker로 하면 에러가 발생합니다. npm i -D faker@5 이렇게 하면 될 것 같은데 해도 될까요?

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
  • faker
  • js
띵동 댓글 1 좋아요 1 조회수 520

도커내부 접속 안됨

해결됨

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

docker run 이미지ID 하고 새로운 터미널 열어서 docker ps 로 containerID 확인 후 docker exec -it 명령어 사용해서 도커 내부로 들어가려고 하면 OCI runtime exec failed: exec failed: unable to start container process: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory: unknown 이런식으로 오류가 뜹니다 왜 그런건가요?? 해결 방법 알려주세요!

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
cgc 댓글 1 좋아요 1 조회수 1549

라우터 리팩토링

미해결

mongoDB 기초부터 실무까지(feat. Node.js)

해당부분 진행중에, userId 를 넣은 get, post, delete 요청을 할경우, 강의와는 다르게 아래와 같이 error 메세지가 뜹니다. 뭐가 문제인걸까요? userId가 아닌, /user 로 하는 라우팅은 잘 되고 있습니다. /// 내용 추가 이후 강의에서 같은 문제가 발생하여, mongoose를 불러오는 코드를 추가하시는데요. 이부분 앞 강의에서 언급이 되거나 수정이 필요해보입니다.

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
viewee 댓글 1 좋아요 0 조회수 361

섹션4 진행중, mongoose 질문

미해결

mongoDB 기초부터 실무까지(feat. Node.js)

MONGO_URI, 이후 부분들은 작성안해도 에러가 안나는데, 굳이해야하나요? 버젼이 업데이트 되면서 작성 안해도 되도록 바뀐걸까요? 또, 이 부분에서, 여기를 작업해주지 않아도 name 이나 age 둘중 하나만 put 해도, null 값이 들어가지 않는데요. 이 역시 버젼이 올라가서 개선이 된걸까요? 만약 그렇다면, 개정된 강의를 만드실 계획이 있으신지도 궁금합니다 지금 사용하고 있는 몽구스 는 7.0.1 입니다.

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
viewee 댓글 1 좋아요 0 조회수 334

섹션1 - ObjectID

미해결

mongoDB 기초부터 실무까지(feat. Node.js)

여기 이부분은 ObjectID를 ID 가 아닌 Id 로 해주면 되는 부분이 아닌가요? ObjectId 로 하면 잘 나오는데요. 굳이 ObjectID 로 선언을 해줘야하는가 싶어서 질문드립니다.

  • javascript
  • node.js
  • aws
  • mongodb
  • rest-api
  • dbms/rdbms
  • 데이터-엔지니어링
viewee 댓글 1 좋아요 0 조회수 441

nginx 에러

해결됨

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

강사님처럼 코드 쓰면 이런화면이나오고 delete하고 다시해보면 밑에 화면처럼 나옵니다.. 무슨 문제일까요 이런화면이나오네요

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
민지홍 댓글 1 좋아요 1 조회수 704

N:M tag 부분 구현 중 findOne 조회 부분 에러

해결됨

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

products.service.ts에서 create 부근에 tag를 저장 하기 전 tag를 미리 조회하는 부분을 구현 중인데 findOne에서 {name: tagname} 을 구현하려고 할 때 다음과 같은 에러가 발생합니다. save에서는 에러가 발생하지 않는데 findOne 조회 부분만 에러가 발생하네요 관련된 코드 같이 보내드립니다. createProduct.input.ts import { InputType, Field, Int } from '@nestjs/graphql'; import { Min } from 'class-validator'; import { ProductSaleslocationInput } from 'src/apis/productsSaleslocation/entities/dto/productSaleslocation.input'; @InputType() export class CreateProductInput { @Field(() => String) name: string; @Field(() => String) description: string; @Min(0) @Field(() => Int) price: number; @Field(() => ProductSaleslocationInput) productSaleslocation: ProductSaleslocationInput; @Field(() => String) productCategotyId: string; @Field(() => [String]) productTags: string[]; } products.entity.ts import { Field, Int, ObjectType } from '@nestjs/graphql'; import { ProductCategory } from 'src/apis/productsCategory/entities/productsCategory.entity'; import { ProductTag } from 'src/apis/productsTags/productTags.entity'; import { User } from 'src/apis/users/users.entity'; import { Column, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; import { ProductSaleslocation } from '../../productsSaleslocation/entities/productsSaleslocation.entity'; @Entity() @ObjectType() export class Product { @PrimaryGeneratedColumn('uuid') @Field(() => String) id: string; @Field(() => String) @Column() name: string; @Field(() => String) @Column() description: string; @Field(() => Int) @Column() price: number; @Field(() => Boolean) @Column({ default: false }) isSoldout: boolean; @DeleteDateColumn() deletedAt: Date; @Field(() => ProductSaleslocation) @JoinColumn() @OneToOne(() => ProductSaleslocation) productSaleslocation: ProductSaleslocation; @Field(() => ProductCategory) @ManyToOne(() => ProductCategory) productCategory: ProductCategory; @Field(() => User) @ManyToOne(() => User) user: User; @JoinTable() @ManyToMany(() => ProductTag, (productTags) => productTags.products) @Field(() => [ProductTag]) productTags: ProductTag[]; } productTags.entity.ts import { Field, ObjectType } from '@nestjs/graphql'; import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Product } from '../products/entities/products.entity'; @Entity() @ObjectType() export class ProductTag { @Field(() => String) @PrimaryGeneratedColumn('uuid') id: string; @Column() @Field(() => String) name: string; @Field(() => [Product]) @ManyToMany(() => Product, (products) => products.productTags) products: Product[]; } products.service.ts import { Product } from './entities/products.entity'; import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { ProductSaleslocation } from '../productsSaleslocation/entities/productsSaleslocation.entity'; import { ProductTag } from '../productsTags/productTags.entity'; @Injectable() export class ProductService { constructor( @InjectRepository(Product) private readonly productRepository: Repository<Product>, @InjectRepository(ProductSaleslocation) private readonly productSaleslocationRepository: Repository<ProductSaleslocation>, @InjectRepository(ProductTag) private readonly productTagRepository: Repository<ProductTag>, ) {} async findAll() { return await this.productRepository.find({ relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async findOne({ productId }) { return await this.productRepository.findOne({ where: { id: productId }, relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async create({ createProductInput }) { // 1. 상품만 등록하는 경우 // const result = await this.productRepository.save({ // ...createProductInput, // // 하나 하나 직접 나열하는 방식 // // name: createProductInput.name, // // description: createProductInput.description, // // price: createProductInput.price, // }); // 2. 상품과 상품거래 위치 같이 등록 const { productSaleslocation, productCategotyId, productTag, ...product } = createProductInput; const result = await this.productSaleslocationRepository.save({ ...productSaleslocation, }); // productTag // ["#electronics, #computer"] const result2 = []; // [{name: ..., id: ...}] for (let i = 0; i < productTags.length; i++) { const tagName = productTags[i].replace('#', ''); // check the tags that has already registered const checkTag = await this.productTagRepository.findOne({ name: tagName, }); // if the tags has been existed if (checkTag) { result2.push(checkTag); // if the tags hasn't been existed } else { const newTag = await this.productTagRepository.save({ name: tagName }); result2.push(newTag); } } const result3 = await this.productRepository.save({ ...product, productSaleslocation: result, // result 통째로 넣기 vs id만 넣기 productCategory: { id: productCategotyId }, productTags: result2, }); return result3; } async update({ productId, updateProductInput }) { const myProduct = await this.productRepository.findOne({ where: { id: productId }, }); const newProduct = { ...myProduct, id: productId, ...updateProductInput, }; return await this.productRepository.save(newProduct); } async checkSoldOut({ productId }) { const product = await this.productRepository.findOne({ where: { id: productId }, }); if (product.isSoldout) { throw new UnprocessableEntityException('Sold out'); } // if(product.isSoldout) { // throw new HttpException('이미 판매 완료 된 상품입니다.', HttpStatus.UNPROCESSABLE_ENTITY) // } } async delete({ productId }) { // 1. 실제 삭제 // const result = await this.productRepository.delete({ id: productId }); // return result.affected ? true : false // 2. 소프트 삭제(직접 구현) - isDeleted // this.productRepository.update({ id: productId }, { isDeleted: true }); // 3. 소프트 삭제(직접 구현) - deletedAt // this.productRepository.update({ id: productId }, { deletedAt: new Date() }); // 4. 소프트 삭제(TypeORM 제공) - softRemove - id로만 삭제 가능 // this.productRepository.softRemove({ id: productId }); // 4 . 소프트 삭제(TypeORM 제공) - softDelete const result = await this.productRepository.softDelete({ id: productId }); return result.affected ? true : false; } } 내용 확인 부탁드립니다.

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
유상우 댓글 2 좋아요 0 조회수 532

안녕하세요 질문있습니다!

해결됨

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

@ObjectType이랑 @EntryType이랑 같이 사용을 할수는 없는건가요?? dto와 entry가 다른부분이 없어서 같이 쓰는게 낫겠다싶어서 시도하려니 안되네요 확실히 역할을 나눠야하는건가요??

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
gogo 댓글 1 좋아요 1 조회수 381

슈퍼 테스트2 강의 질문입니다

미해결

테스트주도개발(TDD)로 만드는 NodeJS API 서버

describe('GET /users는', () => { it('user리스트를 limit만큼 가져왔다', (done) => { request(app) .get('/users') .end((err, res) => { console.log(res.body) done() // 우리가 만든 API서버는 비동기로 동작한다. 그래서 비동기에 대한 처리로 콜백함수를 호출해야 한다?? }) }) }) 강사님께서 콜백함수 done()을 호출하는 부분에서 다음과 같이 말하셨습니다..."우리가 만든 API서버는 비동기로 동작한다. 그래서 비동기에 대한 처리를 해야한다" 그런데 done()이라는 콜백함수를 호출하는 것이 어떤의미에서 비동기에 대한 처린인지 이해가 가지않아 질문을 남깁니다.

  • node.js
  • express
  • tdd
  • rest-api
가보자!! 댓글 1 좋아요 0 조회수 478

강의 3분경 질문

미해결

[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part6: 웹 서버

데이터를 추가하기 위해 배열을 리스트로 변경하고 시작하는 데 배열에서도 크기를 늘려 데이터추가가 가능할 것 같은데 굳이 리스트로 변경하는 이유가 무엇인지 궁금합니다!

  • rest-api
  • blazor
  • web-api
  • asp.net-core
좋은 캥거루 댓글 1 좋아요 0 조회수 330

인기 태그

인프런 TOP Writers

주간 인기글