inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

JWT refresh 에대해 질문이 있습니다.

미해결

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

jwt refresh 토큰은 access 토큰이 만료되었을때 재발급을 위한 토큰이라고 알고있는데요 보통 refresh 는 시간을 길게주고 access 토큰은 짧게 줘서 관리하는것으로 알고있습니다. 근데 강의를 다듣고 정리하는데 refresh에 대해 궁금증이 생겼습니다. 강의에서는 따로 DB에 저장안한거 같은데 DB에 저장하지않고 관리하는거라면 refresh도 만료시간이 있을텐데 이걸 어떻게 관리하는것인지요? http only cookie로 클라이언트에 건내줘서 클라이언트가 만료될때마다 서버쪽으로 던지는것인지 아니면 DB에 저장해서 관리하는것인지 궁금합니다. 어떤것이 정답이라고 할수 없겠지만 보통 실무에서는 어떻게 관리할까요

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

SpringCloud Gateway 연동

미해결

Java 마이크로서비스(MSA) 프로젝트 실습

https://github.dev/ishrhrl39/3-3.Microservice 강의중 유레카 대쉬보드에는 아이템 서비스가 잘 표현되는데 왜 postman 요청은 404가 뜨는지 원인을 못찾겠네요..라우팅쪽 문제인것같은데..

  • java
  • spring
  • rest-api
  • spring-boot
  • msa
김효성 댓글 1 좋아요 0 조회수 190

http Exception filter 적용

미해결

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

http Exception filter 적용이 안됩니다. import { ArgumentsHost, Catch, ExceptionFilter, HttpException, } from '@nestjs/common'; import { Response } from 'express'; @Catch(HttpException) export class HttpExceptionFilter implements ExceptionFilter { catch(exception: HttpException, host: ArgumentsHost) { console.log('exception', exception); const ctx = host.switchToHttp(); const response = ctx.getResponse<Response>(); const status = exception.getStatus(); const err = exception.getResponse() as | string | { error: string; statusCode: number; message: string | string[] }; console.log('err', err); if (typeof err !== 'string' && err.error === 'Bad Request') { return response.status(status).json({ ok: false, statusCode: status, data: err.message, }); } response.status(status).json({ ok: false, statusCode: status, data: err, }); } } 위처럼 하고난뒤에 main.ts 파일에 app.useGlobalFilters(new HttpExceptionFilter()); 추가했는데 위처럼 에러 포맷이 안나옵니다. const foundUser = await this.dataSource.getRepository(UserEntity).findOne({ where: { id } }); if (!foundUser) { console.log('User not found'); throw new BadRequestException('User not found'); } { "response": { "message": "User not found", "error": "Bad Request", "statusCode": 400 }, "status": 400, "options": {}, "message": "User not found", "name": "BadRequestException" }

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

mydocker

해결됨

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

mongoose . connect ( "mongodb://my-database:27017/mydocker" ). then (() => console . log ( "db접속성공" )). catch (( err ) => console . log ( "db접속실패" , err )) 저는 이 부분이 터미널에 db접속이나 db접속 실패가 터미널창에 안 떠요. 터미널창에 왜 안뜰까요?? 우분투라서 sudo docker-compose build sudo docker-compose up 하면 선생님은 db접속유무가 뜨는데 저는 터미널창에 안 떠요 그리고 mydocker이부분은 docker-compass에 들어가면 선생님은 databases에 admin config local 에네랑 같이 있던데 강의에서 언제 생성을 했었나요?

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

post가 안되요

미해결

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

"Required request body is missing: public kr.co .joneconsulting.myrestfulservice.bean.User kr.co .joneconsulting.myrestfulservice.controller.UserController.createUser( kr.co .joneconsulting.myrestfulservice.bean.User)", 이런 에러가 뜨네요 @PostMapping("/users") public User createUser(@RequestBody User user) { return service.save(user); }

  • rest-api
  • spring-boot
kimoon Hong 댓글 1 좋아요 0 조회수 171

regionList 클릭시 해당 cities가 안나옵니다.

해결됨

한 번에 끝내는 자바스크립트: 바닐라 자바스크립트로 SPA 개발까지

혼자서 찾아보려고 했는데 도저히 모르겠네요 ㅜ 오류메세지는 나오는건 없고 제목과 같습니다. region을 선택하면 해당 cities가 나와야하는데 안나와요 ㅜ import Header from "./components/Header.js"; import RegionList from "./components/RegionList.js"; import CityDetail from "./components/CityDetail.js"; import CityList from "./components/CityList.js"; import { request } from "./components/api.js"; export default function App($app){ const getSortBy = () => { if (window.location.search){ return window.location.search.split('sort=')[1].split('&')[0]; } return 'total'; }; const getsearchWord = () => { if(window.location.search && window.location.search.includes('search=')){ return window.location.search.split('search=')[1] } //뒤에 있는 값을 반환 return ''; }; this.state={ startIdx : 0, sortBy : getSortBy(), region: '', searchWord: getsearchWord(), cities:'', }; const header = new Header({ $app, initialState:{ sortBy:this.state.sortBy, searchWord:this.state.searchWord }, handleSortChange: async(sortBy) => { const pageUrl = `/${this.state.region}?sort=${sortBy}`; history.pushState( null, null, this.state.searchWord ? pageUrl + `&search=${this.state.searchWord}` : pageUrl ); //변경된 정렬기준을 적용한 새로운 데이터를 불러옴 (매개변수로 전달받은 새로운 정렬기준인 sortBy 값을 넣어야함) const cities = await request(0, this.state.region, sortBy, this.state.searchWord); // 변경된 상태값을 업데이트 this.setState({ ...this.state, startIdx:0, sortBy: sortBy, cities: cities, }); }, handleSearch: async(searchWord) => { //웹사이트 주소를 알맞게 변경 history.pushState( null, null, `/${this.state.region}?sort=${this.state.sortBy}&search=${searchWord}` ); const cities = await request(0, this.state.region, this.state.sortBy, searchWord); this.setState({ ...this.state, startIdx:0, searchWord: searchWord, cities: cities }) }, }); const regionList = new RegionList({ $app, initialState:this.state.region, handleRegion: async(region) => { history.pushState(null, null, `/${region}?sort=total`); const cities = await request(0, region, 'total'); console.log("cities",cities) this.setState({ ...this.state, startIdx: 0, region: region, sortBy: 'total', cities: cities, searchWord: '', }); }, }); const cityList = new CityList({ $app, initialState:this.state.cities, // 아래는 더보기 버튼을 눌렀을 때 실행되는 것 handleLoadMore: async() => { const newStartIdx = this.state.startIdx + 40; const newCities = await request(newStartIdx, this.state.region, this.state.sortBy, this.state.searchWord); this.setState({ ...this.state, startIdx : newStartIdx, cities:{ cities:[...this.state.cities.cities, ...newCities.cities], isEnd: newCities.isEnd, } }) } }); const cityDetail = new CityDetail(); this.setState = (newState) => { this.state = newState; cityList.setState(this.state.cities); header.setState({sortBy:this.state.sortBy, searchWord:this.state.searchWord}); regionList.setState(this.state.region); }; const init = async() => { const cities = await request(this.state.startIdx, this.state.sortBy, this.state.region, this.state.searchWord); this.setState({ ...this.state, cities: cities, //api 호출의 결과인 cities }); }; init(); } export default function RegionList({$app, initialState, handleRegion}){ this.state = initialState; this.$target = document.createElement('div'); this.$target.className = 'region-list'; this.handleRegion = handleRegion; $app.appendChild(this.$target); this.template = () => { const regionList = [ '🚀 All', '🌏 Asia', '🕌 Middle-East', '🇪🇺 Europe', '💃 Latin-America', '🐘 Africa', '🏈 North-America', '🏄 Oceania', ]; let temp = ``; regionList.forEach((elm) => { let regionId = elm.split(' ')[1]; temp += `<div id=${regionId}>${elm}</div>`; }); return temp; }; this.render = () => { this.$target.innerHTML = this.template(); let $currentRegion; if(this.state){ $currentRegion = document.getElementById(this.state); $currentRegion && ($currentRegion.className = 'clicked'); } else { document.getElementById('All').className = 'clicked'; } const $regionList = this.$target.querySelectorAll('div'); $regionList.forEach((elm) => { elm.addEventListener('click', () => { this.handleRegion(elm.id); }); }); }; this.setState = (newState) => { this.state = newState; this.render(); }; this.render(); }

  • javascript
  • rest-api
  • spa
  • dom
최유진 댓글 1 좋아요 0 조회수 260

one to many mapping에 관하여

미해결

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

oneToMany mapping와 manyToOne mapping에서 users.tntity.ts에 있는 posts항목에 의문이 생겨 질문 드립니다. PostModel list로 되어있는데 DB table은 2dimension이 되지 않는다고 하신것 같아서요 혹시 내부는 어떻게 구현이 되어 있는지 알 수 있나요

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
이상현 댓글 2 좋아요 0 조회수 147

BearerTokenGuard 구현해보기

미해결

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

코드팩토리 디스코드에 질문하면 더욱 빠르게 질문을 받아 볼 수 있습니다! [코드팩토리 디스코드] https://bit.ly/3HzRzUM 토큰이 없다고 듭니다. 토큰값이 담기는건 확인되는데 포스트맨 authorization : Bearer refreshToken 넣어보면 토큰이 없습니다. 401 떠서 다시 계속 해보는데 못찾겠습니다.

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
getJob = Plz 댓글 2 좋아요 0 조회수 145

select값이 출력이 안돼요

해결됨

한 번에 끝내는 자바스크립트: 바닐라 자바스크립트로 SPA 개발까지

input 값은 나오는데 select 값은 출력이 안돼요 ㅠ 오류 메세지도 따로 나오는 건 없고 console.log로 cities 값을 볼려고 했는데 빈 Array가 나옵니다 ㅠ import Header from "./components/Header.js"; import RegionList from "./components/RegionList.js"; import CityDetail from "./components/CityDetail.js"; import CityList from "./components/CityList.js"; import { request } from "./components/api.js"; export default function App($app){ const getSortBy = () => { if (window.location.search){ return window.location.search.split('sort=')[1].split('&')[0]; } return 'total'; }; const getSearchWorld = () => { if(window.location.search && window.location.search.includes('search=')){ return window.location.search.split('search=')[1] } //뒤에 있는 값을 반환 return ''; }; this.state={ startIdx : 0, sortBy : getSortBy(), searchWorld: getSearchWorld(), region: '', cities:'', }; const header = new Header({ $app, initialState:{ sortBy:this.state.sortBy, searchWorld:this.state.searchWorld }, handleSortChange: async(sortBy) => { const pageUrl = `/${this.state.region}?sort=${sortBy}`; history.pushState( null, null, this.state.searchWorld ? pageUrl + `&search=${this.state.searchWorld}` : pageUrl ); //변경된 정렬기준을 적용한 새로운 데이터를 불러옴 (매개변수로 전달받은 새로운 정렬기준인 sortBy 값을 넣어야함) const cities = await request(0, this.state.region, sortBy, this.state.searchWorld); console.log(cities) // 변경된 상태값을 업데이트 this.setState({ ...this.state, startIdx:0, sortBy: sortBy, cities: cities, }); }, handleSearch: async(searchWorld) => { //웹사이트 주소를 알맞게 변경 history.pushState( null, null, `/${this.state.region}?sort=${this.state.sortBy}&search=${searchWorld}` ); const cities = await request(0, this.state.region, this.state.sortBy, searchWorld); this.setState({ ...this.state, startIdx:0, searchWorld: searchWorld, cities: cities }) }, }); const regionList = new RegionList(); const cityList = new CityList({ $app, initialState:this.state.cities, // 아래는 더보기 버튼을 눌렀을 때 실행되는 것 handleLoadMore: async() => { const newStartIdx = this.state.startIdx + 40; const newCities = await request(newStartIdx, this.state.sortBy, this.state.region, this.state.searchWorld); this.setState({ ...this.state, startIdx : newStartIdx, cities:{ cities:[...this.state.cities.cities, ...newCities.cities], isEnd: newCities.isEnd, } }) } }); const cityDetail = new CityDetail(); this.setState = (newState) => { this.state = newState; cityList.setState(this.state.cities); header.setState({sortBy:this.state.sortBy, searchWorld:this.state.searchWorld}); }; const init = async() => { const cities = await request(this.state.startIdx, this.state.sortBy, this.state.region, this.state.searchWorld); this.setState({ ...this.state, cities: cities, //api 호출의 결과인 cities }); }; init(); }

  • javascript
  • rest-api
  • spa
  • dom
최유진 댓글 2 좋아요 1 조회수 254

nestjs routing 질문있습니다.

미해결

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

controller에서 /test/:id라는 숫자를 받는 get 엔드포인트가 있고 /test/info라는 정보를 주는 routing을 만들고 싶은데 test/info라고 호출하면 test/:id로 들어가더라구요 이걸 해결할 수 있는 방법이 있을까요?

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
헤이나우 댓글 2 좋아요 0 조회수 108

repository생성후 반환 함수 관련 문의

미해결

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

안녕하세요 181강에서 보면 리포지토리를 save 메서드로 생성한다음 반환해줄때 다시 찾아서 반환해주는데 실제 프로젝트 구현시도 이런식으로 해야되는건가요? 그냥 save() 메서드의 리턴을 await 로 변수에 받은다음 그 변수를 반환하면 안되나요? 181강 메세지 보내기 마무리하기

  • javascript
  • typescript
  • rest-api
  • nestjs
  • backend
김현철 댓글 2 좋아요 0 조회수 117

12강 듣던중...Controller.cs 질문입니다.

미해결

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

HomeController.cs 에서 LoginController.cs 확장하고 NewUser 도 분리할때 발견 한건데요...한참 헤맸네요... LoginController -> LoginContloller 즉 Controller 스펠링은 규칙 정의된 용어 인가요? 이게 다르면 404notfound 뜨더라고요 어차피 상속 받았고 클래스 이름 같으면 되는거 아닌가 했는데... Views 폴더도 마찬가지인지....그 안에 폴더 이름을 Home이 아닌 hom 으로 사용하고 진행할 경우 인지가 안되나요? 몬가 절대 변경되면 안되는 것들이 있는것 같아서요 그리고 ASP.NET CORE 웹 서버 개발하면 디버깅 노하우 강의도 해주셧으면 좋겠어요....이게 웹으로 넘어오니 디버깅이 쉽지 않네요 ㅋㅋㅋ

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

Putty에서 nginx를 vi로 수정할때 오류

미해결

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

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 제목과 같이 putty 터미널에서 vi로 vi /etc/nginx/sites-.../ 에서 수정하는데 저는 다음과 같은 화면이 나옵니다. ㅠㅠ 이거 왜 이런건가 요

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
김태훈 댓글 3 좋아요 0 조회수 360

mysql과 선생님의 깃허브 코드연결

미해결

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

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 선생님께서 올리신 완성본 코드를 깃허브에서 다운받아서 결과를 보고싶은데, 지도상에 음식점들의 핀이 뜨지 않습니다 ㅠ 아마 sql상에 더미 데이터들이랑 연결이 안되어서 그런것같은데 지도상에 마커들이 뜨게 하려면 어떻게 해야할까요 도와주세요

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
김태훈 댓글 1 좋아요 0 조회수 229

nodemon 실행오류

미해결

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

[nodemon] 3.1.7 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting node index.js [nodemon] app crashed - waiting for file changes before starting... 다음과 같은 오류가 발생하는데 어떻게 해결해야하나요 ㅠ

  • HTML/CSS
  • javascript
  • aws
  • git
  • mysql
  • rest-api
  • github
김태훈 댓글 2 좋아요 0 조회수 291

LING #1 에서.. 서버 GC문제

미해결

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

요즘도 여전히 LINQ는 GC문제를 야기할 가능성이 있어 UNITY에서는 피하는 편입니다. 서버의 경우 GC를 끄고 점검때 재부팅하는식으로 뭐 좀 쌓이든 비효율적이든 대충 뭉개고 갔었었고요. 유니티는 뭐 저사양 기기도 생각해야 하니 여전히 저럴 것이고 서버에서 최신 사양의 C# 버전을 택했을때 LINQ가 메모리 문제를 야기할 가능성은 없나요... 음...애초에 저런거 일일이 잡느니 램증설각이 보이긴 하네요

  • rest-api
  • blazor
  • web-api
  • asp.net-core
댓글 3 좋아요 0 조회수 328

컴포넌트에 매개변수 전달하는 방식에 대하여

해결됨

한 번에 끝내는 자바스크립트: 바닐라 자바스크립트로 SPA 개발까지

프로젝트 작성할 때 ,APP.js와 components폴더 안의 js모듈로 보통 구성을 하시는데, 왜 APP.js에서 $app을 매개변수로 받을 때는 소괄호에서 바로 받는데, 다른 컨포넌트 내부 js모듈에서는 중괄호로 받는건가요? export default function App($app) {} export default function CityList({ $app, initialState,handleLoadMore }) {} APP의 경우 전달받는게 하나인데, CityList의 경우 APP에서 여러개의 매개변수를 받아오기 떄문에 구조분해로 받아오는 건가요? 만약 그렇다면 한개만 매개변수로 받아오는 경우, CityList도 (소괄호)안에 {중괄호}없이 바로 매개변수를 써도 되는 건가요?

  • javascript
  • rest-api
  • spa
  • dom
ggang89 댓글 2 좋아요 0 조회수 191

coolsms statuscode 2000 인데 전송안돼는 경우 확인.

해결됨

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

coolsms statuscode 2000 인데 폰에 메시지가 안오면 번호도용문자차단 서비스 사용중인지 확인해보세요. 이게 인터넷 문자메시지를 막는 모양입니다. 해지신청하고 3~7일 정도 시간이 걸려 적용된답니다. 저도 신청하고 대기중...

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

require 질문드립니다.

해결됨

한 번에 끝내는 자바스크립트: 바닐라 자바스크립트로 SPA 개발까지

안녕하세요! 동물앨범 수업 따라가던 중 질문이 생겨 문의드립니다. require함수 작성시 밑줄이 생기며 require is not defined 라는 에러가 뜨는데, 저대로 실행을 하면 정상 작동하긴 합니다. 구글링을 해보니 package.json파일에 "type":commonJs를 추가하라고 하여 했는데도 똑같이 밑줄이 생깁니다. 어떤게 문제일까요?

  • javascript
  • rest-api
  • spa
  • dom
이원현 댓글 1 좋아요 0 조회수 156

인기 태그

인프런 TOP Writers

주간 인기글