inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

neok님의 게시글

neok neok

@neok

수강평 작성수
3
평균평점
4.7

게시글 6

질문&답변

500 server error

해결했습니다! nodebird-api v1쪽에서 에러가 있었나봐요. 감사합니다!

좋아요수
0
댓글수
10
조회수
15915

질문&답변

500 server error

네 8001, 8002 제대로 작동하는데 8003/test만 안되네요,,

좋아요수
0
댓글수
10
조회수
15915

질문&답변

500 server error

네 깃허브에 있는 코드 복사했는데도 그러네요ㅠㅠ 에러 처리는 되어있습니다. index.js const express = require ( 'express' ), axios = require ( 'axios' ); const router = express . Router (); router . get ( '/test' , async ( req , res , next ) => { try { if (! req . session . jwt ) { // 세션에 토큰이 없으면 const tokenResult = await axios . post ( 'http://localhost:8002/v1/token' , { clientSecret: process . env . CLIENT_SECRET , }); if ( tokenResult . data && tokenResult . data . code === 200 ) { // 토큰 발급 성공 req . session . jwt = tokenResult . data . token ; // 세션에 토큰 저장 } else { // 토큰 발급 실패 res . json ( tokenResult . data ); // 발급 실패 사유 응답 } } // 발급받은 토큰 테스트 const result = await axios . get ( 'http://localhost:8002/v1/test' , { headers: { authorization: req . session . jwt }, }); res . json ( result . data ); } catch ( error ) { console . error ( error ); if ( error . response . status === 419 ) { // 토큰 만료 시 res . json ( error . response . data ); } next ( error ); } }); module . exports = router ;

좋아요수
0
댓글수
10
조회수
15915

질문&답변

return 여부

감사합니당!

좋아요수
0
댓글수
2
조회수
377

질문&답변

webstorm에서 www파일

감사합니다! 전역 명령어들이 안먹혀서 폴더랑 파일을 일일이 만들어서 하다보니 그렇게 됐어요ㅠㅠ

좋아요수
0
댓글수
2
조회수
277

질문&답변

matchedUrl 정의할 때

감사합니다! 이해했어요!

좋아요수
0
댓글수
2
조회수
327