묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
nest.js와 typeORM 지식이 있어야할까요?
강의 후반부에 백엔드를 공부하기 위해선 react-query처럼 선수지식이 있어야될까요?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
password is required 오류
docker-compose up 이후에 postgres 확장자를 이용하여 연결하려고 할 때 모든 과정 이후에 password is required 오류가 뜹니다 ㅠㅠ포트 변경 후에도 동일하고postgres-data 폴더 삭제 -> 생성 후에도 동일합니다ㅠㅠ
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
5분 경에 질문있습니다.
@Post() @UseGuards(AccessTokenGuard) @UseInterceptors(TransactionInterceptor) async postPost(@User("id") userId: number, @Body() body: CreatePostDto, @QueryRunner() qr: QR) { // temp -> posts로 옮긴다음에 포스팅 const post = await this.postsService.createPost(userId, body, qr); // throw new InternalServerErrorException("에러가 생겼습니다."); // 포스트만 생성하고, 이미지는 생성안해버림 throw 에러에서 걸림. 원래는 포스트 게시글이 생기면 안됨. for (let i = 0; i < body.images.length; i++) { await this.PostsImagesService.createPostImage( { post, order: i, path: body.images[i], type: ImageModelType.POST_IMAGE, }, qr, ); } // Transaction 타입에 따라서 Transaction이 커밋 되기전에 최신 값을 가져오지 못할 수 있다. (service에서 해당 문제 처리 직접 qr받아서) // 가장 최근상태의 포스트를 받아와서, 반환해줌. return this.postsService.getPostById(post.id, qr);Transaction 타입에 따라서 Transaction이 커밋 되기 전에 최신 값을 가져오지 못할 수 있다고 하셔서, getPostById service에서 직접적으로 qr을 주입받아서, 사용했는데 정확히 어떤 이유로 최신 값을 못받아오는지 잘 이해가 안가서, 자세히 설명을 해주실 수 있나요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
프로젝트가 만들어지지 않습니다.
맥북 m1으로 똑같이 설정을 했습니다.그리고 npx react-native init MatzipApp으로 프로젝트를 실행하면 아래오 같은 메시지가 나옵니다. Downloading template ✔ Copying template ⠸ Processing template➤ YN0000: Retrieving https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js ⠙ Processing template➤ YN0000: Saving the new release in ../../../.yarn/releases/yarn-3.6.4.cjs ➤ YN0000: Done in 0s 666ms ⠼ Processing template➤ YN0000: Successfully set nodeLinker to 'node-modules' ✔ Processing template ⠸ Installing dependencieserror Installing pods failed. This doesn't affect project initialization and you can safely proceed. However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section. ✖ Installing dependencies info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field. For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation ✔ Initializing Git repository Run instructions for Android: • Have an Android emulator running (quickest way to get started), or a device connected. • cd "/Users/xxx/React-Project/React-Native/MatzipApp" && npx react-native run-android Run instructions for iOS: • cd "/Users/sss/React-Project/React-Native/MatzipApp/ios" • Install Cocoapods • bundle install # you need to run this only once in your project. • bundle exec pod install • cd .. • npx react-native run-ios - or - • Open MatzipApp/ios/MatzipAppcd .xcodeproj in Xcode or run "xed -b ios" • Hit the Run button Run instructions for macOS: • See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.이런 메시지가 뜨고 npm run start로 실행을 하면 command not found메시지가 뜨면서 애뮬레이터도 실행이 안됩니다.ㅠㅠ
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
[6-7] FeedDetail화면에서 뒤로가기시(goBack) 질문
안녕하세요.하단 탭 메뉴 중 즐겨찾기 탭으로 이동하여 FeedItem 선택 후 FeedDetail 화면으로 이동한 후 뒤로 가기를 누르면 즐겨찾기 탭 으로 가는게 아니라 FeedHome 탭으로 이동합니다.즐겨찾기탭으로 돌아가게 하려면 어떻게 해야 될까요. ❗질문 작성시 참고해주세요최대한 상세히 현재 문제(또는 에러)와 코드(또는 github)를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다.맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요!
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
docker-compose.yml 파일 환경변수 관리
안녕하세요,docker-compose.yml 파일 같은 경우는 .gitignore 처리를 하는 파일인지, 아니면 이 부분도 환경변수로 데이터 접근하는 값들을 환경변수로 바꿔줘야하는지 어떻게 관리하는지 알고 싶어 질문드립니다.
-
해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
노드 삭제 재설치
그러면 안되지만 잘못 설치했을경우 노드 삭제 재설치 및 버전 업데이트 하는 방법에 대해서 혹시 유튜브에라도 해당 내용이 있을실까요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
ios 앱 심사 정보
안녕하세요 친절한 강의에 정말 감사드립니다^^ios앱 심사 정보 작성에 여쭤볼게 있는데요.심사 과정에 통과하려면 backend 배포가 된 상태여야 심사가 가능하니, backend 배포가 선행돼야 하는건가요?앱에 로그인할 수 있도록 사용자 이름 및 암호를 입력하십시오. 앱 심사를 완료하려면 로그인 정보가 필요합니다.
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
No overload matches this call.
안녕하세요 강사님강의 진행중에 아래와 같은 안내가 있는데 제공해주신 강의 깃헙 코드와 비교했을 때 아무리 찾아봐도 다른 코드가 보이질 않습니다 따로 에러는 발생하지 않는데 혹시 일종의 경고의 메세지 같은걸까요??
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
Prettier 세팅 관련 문의!
1분 30초 즈음에..탭키 눌러서 저장하시면, 16, 17, 18번쨰 줄 이렇게 한줄씩 정렬이 되시는데저는 해당 부분이 자동으로 프리티어 정렬이 들어갑니다 .혹시 프리티어 세팅 부분을 알 수 있을까요?
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
저는왜 렌더링 화면이 다를까요 ?
저는 이 화면으로만 보이고 domain 적는 구간이없는데.. 왜그럴까요 계속 로그인 상태 알람만 발생합니다. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>API 서버 로그인</title> <style> .input-group label { width: 200px; display: inline-block; } </style> </head> <body> {% if user and user.id %} <span class="user-name">안녕하세요! {{user.nick}}님</span> <a href="/auth/logout"> <button>로그아웃</button> </a> <fieldset> <legend>도메인 등록</legend> <form action="/domain" method="post"> <div> <label for="type-free">무료</label> <input type="radio" id="type-free" name="type" value="free"> <label for="type-premium">프리미엄</label> <input type="radio" id="type-premium" name="type" value="premium"> </div> <div> <label for="host">도메인</label> <input type="text" id="host" name="host" placeholder="ex) zerocho.com"> </div> <button>저장</button> </form> </fieldset> <table> <tr> <th>도메인 주소</th> <th>타입</th> <th>클라이언트 비밀키</th> </tr> {% for domain in domains %} <tr> <td>{{domain.host}}</td> <td>{{domain.type}}</td> <td>{{domain.clientSecret}}</td> </tr> {% endfor %} </table> {% else %} <form action="/auth/login" id="login-form" method="post"> <h2>NodeBird 계정으로 로그인하세요.</h2> <div class="input-group"> <label for="email">이메일</label> <input id="email" type="email" name="email" required autofocus> </div> <div class="input-group"> <label for="password">비밀번호</label> <input id="password" type="password" name="password" required> </div> <div>회원가입은 localhost:8001에서 하세요.</div> <button id="login" type="submit">로그인</button> </form> <script> window.onload = () => { if (new URL(location.href).searchParams.get('error')) { alert(new URL(location.href).searchParams.get('error')); } }; </script> {% endif %} </body> </html> view에 login도 위와 같이 들어가있습니다.const { User, Domain } = require("../models"); const { v4: uuidv4 } = require("uuid"); exports.renderLogin = async (req, res, next) => { try { const user = await User.findOne({ where: { id: res.user?.id || null }, include: { model: Domain } }) res.render("login", { user, domains: user?.Domains }) } catch (err) { console.error(err) next(err); } } exports.createDomain = async (req, res, next) => { try { await Domain.create({ UserId: req.user.id, host: req.body.host, type: req.body.type, client: uuidv4() }) res.redirect("/"); } catch (err) { console.error(err); next(err); } } controller에서도 강의대로 잘 렌더가 들어가있습니다. 그러니 화면이 보이긴하는데 왜 저만안보일까요..- app.js에 passport의 initialize(), session() 함수 선언되어있습니다. - cookie도 있습니다.- db에 user도 있습니다.
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
android MainActivity.java 문의 건
안녕하세요 강사님2:05 진행 과정에서 저는 java가 아닌 Kotlin으로 되어있어서요ChatGPT로 변경하는 요청을 했는데 아래와 같이 안내하고 있습니다혹시 이대로 진행하면 될까요? override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(null) }
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
input에 입력 시 오류 문의 건
안녕하세요 강사님input에 입력을 하면 텍스트가 자꾸 사라지면서 로그에는 아래와 같이 오류가 발생하는데 혹시 해결방법을 알 수 있을까요...!?
-
미해결웹 게임을 만들며 배우는 React에 TypeScript 적용하기
express response 타입
type JsonBody = { success: boolean; data: any; }; declare global { namespace Express { export interface Response { json: (body: JsonBody) => this; test: (body: JsonBody) => this; } } } export {};라이브러리 버전express 4.18.2@types/express 1.17.17 get, post 등 모든 요청에서 응답으로 res.status(200).json({success:true, data: []}) 이런 형식으로 코드 자동완성 기능 이용하려고 위와 같이 Express Response에 json 타입을 오버로딩 했는데 res.status(200).json 코드를 입력하면 오버로딩한 타입은 자동완성추천에 뜨지않고 express 자체에서 작성해둔 타입 json(body?: any): Response<any, Record<string, any>, number> 이런 타입만 뜹니다.json 아래에 작성한 test는 res.status(200).test 작성시 자동완성 추천도 잘되고 객체에 success랑 data 입력하게 자동완성 기능이 잘 동작하는데 json만 동작이 안됩니다. 어떻게하면 해결할 수 있을까요?
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
시뮬레이터가 안열립니다.
ios는 저 상태로 무반응이구요. 안드로이드는 이런에러가 나는데 다른분 질문 참고해서 안드 시뮬레이터를 켜고 하면 되긴하는데미리 시뮬레이터를 켜지 않은 상태에서는 저런 에러가 나네요특이사항은 예전에 혼자 expo로 간단하게 ios, android 시뮬레이터연결 해본적 있었습니다.방금도 expo 프로젝트에서는 ios랑 android 시뮬레이터 잘 오픈되구요혹시 몰라 구글링해서 xcode 캐시삭제해보라해서 삭제한 상태구요 "react-native": "0.72.6" "node": v20.10.0 nvm:0.39.7 watchman : 2024.04.22.00 ruby : ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin23] xcode: 15.3
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
guard와 controller 토큰 추출 / 디코드 중복 코드 관련 질문
// POST auth/login/email @Post('login/email') @UseGuards(BasicTokenGuard) // authorization 기준으로 rawToken을 받아옴. postLoginEmail(@Headers('authorization') rawToken: string, @Request() req) { // email:password -> base64 // adsfasdfasfdad => email:password const token = this.authService.extractTokenFromHeader(rawToken, false); const credentials = this.authService.decodeBasicToken(token); return this.authService.loginWithEmail({ email: credentials.email, password: credentials.password, }); }질문이 있습니다.req.user.email , req.user.password 이런식으로 Guard를 통해 요청에 대한 값을 받아올 수 있다고 설명해주셨습니다. 실제로 guard 부분에서, 해당 extractTokenFromHeader부분과, decodeBasicToken 부분이 겹치는 것 같은데, 이중적으로 처리해주는 것이 맞는지 아니면 아래와 같이 req.user.password 부분을 디코드 해주어서, 중복 부분을 생략해 줄 수 있을 것이라고 생각하는데 어떤 접근방법이 맞는지 궁금합니다! 이 부분도 중복을 해결해야 하는 부분 아닌가 해서 궁금합니다! // POST auth/login/email @Post('login/email') @UseGuards(BasicTokenGuard) // authorization 기준으로 rawToken을 받아옴. postLoginEmail(@Headers('authorization') rawToken: string, @Request() req) { // 여기는 req.user.password를 직접 입력하게되면 인코드된 값이므로, 디코드 된 값이 들어가야 할 것 같긴합니다. (JWT 모듈같은 것을 활용해서!) return this.authService.loginWithEmail({ email: req.user.email, password: req.user.password, }); }
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
api호출 제한이 안되는 질문에서 제로초님이 제공해주신 코드중에서의 질문입니다!
해당 질문에서 제로초님이const limiter = rateLimit({ widowMs: 60 * 1000, max: (req, res) => { if (req.user?.type === 'premium') { return 10 } return 1; }, handler(req, res) { res.status(this.statusCode).json({ code: this.statusCode, message: `1분에 ${req.user?.type === 'premium' ? '열' : '한'} 번만 요청 할 수 있습니다...`, }); }, }); exports.apiLimiter = async (req, res, next) => { let user; if (res.locals.decoded) { user = await User.findOne({ where: { id: res.locals.decoded.id } }); } req.user = user; limiter(req, res, next); };이렇게 주셨는데 여기서 limiter을 상수형태로 참조하게끔하면 그럼 다수의 유저가 호출을 하게 될때limiter이 같은 함수를 가르키고있어서 다른 유저가 호출한 api횟수에 영향을 받게 되지않나요? 강의 너무 잘보고있습니다!
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
시뮬레이터가 작동하지 않아요ㅠ
상황: 1-5 강의 듣는중이고, ruby 2.7.6 까지 세팅 하였습니다.(과정에 조금 문제가 있었지만 성공);npx ~ --version 0.72.6 에러 없이 성공그 후 npm run ios >> 시뮬레이터 뜸 >> 앱 실행 안됨에러 내용이 너무 많아 처음과 끝만 올렸어요ㅠinfo Found Xcode workspace "MatdoriApp.xcworkspace" info Found booted iPhone SE (3rd generation) info Launching iPhone SE (3rd generation) info Building (using "xcodebuild -workspace MatdoriApp.xcworkspace -configuration Debug -scheme MatdoriApp -destination id=CBBF6748-CE87-48B0-B69A-") info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor . . . error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening MatdoriApp.xcworkspace. Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MatdoriApp.xcworkspace -configuration Debug -scheme MatdoriApp -destination id=CBBF6748-CE87-48B0-B69A-14A62A514208 User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES Prepare packages warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MatdoriApp' from project 'MatdoriApp') warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MatdoriApp' from project 'MatdoriApp') --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:CBBF6748-CE87-48B0-B69A-, OS:17.4, name:iPhone SE (3rd generation) } { platform:iOS Simulator, id:CBBF6748-CE87-48B0-B69A-, OS:17.4, name:iPhone SE (3rd generation) } ** BUILD FAILED ** The following build commands failed: CompileC /Users/ajrfyd/Library/Developer/Xcode/DerivedData/MatdoriApp-dzlyrdyzrnadjbcljrudendrtkwk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/arm64/FlipperPlatformWebSocket.o /Users/ajrfyd/Desktop/practice/inflearn/MatdoriApp/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'FlipperKit' from project 'Pods') (1 failure) 환경: OS: macOS 14.4.1CPU: (8) arm64 Apple M1 Node: 18.16.0 Yarn: 1.22.22 npm: 9.5.1Watchman: 2024.04.15.00CocoaPods: 1.15.2iOS SDK: Platforms: - DriverKit 23.4 - iOS 17.4 - macOS 14.4 - tvOS 17.4 Android SDK: Not Found // 이건 왜 그런지 몰겠음...강의 따라 설치 되어 있는데..ㅠAndroid Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 15.3/15E204aJava: 17.0.11 Ruby: 2.7.6npmPackages: "@react-native-community/cli": Not Found react: 18.2.0 react-native: 0.72.6 react-native-macos: Not FoundnpmGlobalPackages: "*react-native*": Not FoundAndroid: hermesEnabled: true newArchEnabled: falseiOS: hermesEnabled: true newArchEnabled: false 에러 내용으로 아무리 검색 해 봐도 답이 없네요ㅠ도와 주실 수 있을까요??참고로 예전에 리엑트 네이티브, 엑스포 프로젝트 좀 했었고,이번에 한번 다시 듣고파 결제 했습니다 .xcode 버전 지원안된다 하여 최신으로 깔고, watchmanpython에러 잡아서 다시 깔고, 루비 이슈 해결하고, 안드로이드 스튜디오는 딱히 다시 깔지 않아도 될것 같아 놔두고 설명해 주신 이미지 13이랑 32?? 등등 깔고, 공식문서에서 이미 깔린 react-native/cli는 지우는걸 추천해서 지우고 이정도 입니다 ..
-
해결됨[리뉴얼] 타입스크립트 올인원 : Part1. 기본 문법편
타입스크립트 교과서 p83
type J = {} & string; // type J = {} & string책에 {} 와 string의 교집합이 string 이라고 나와있는데, 다음과 같이 {} & string 이렇게 나오는데 tsconfig에서 설정을 건드려야 할까요?? 혹시몰라 playground 에서 해도 이렇게 나오네요
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
Column Property 질문드립니다
안녕하세요섹션 10에 [Column Property 정리하기] 수강중 3분 40초 부분에 질문드립니다.@Column({}) 에 type을 변경했을때 데이터 안에 title이 전부 null로 변경되는데 유지되게 할 수 있는 방법 있을까요??