-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX/#159] 새로고침 오류(redirection) 해결 #160
Open
minseok1015
wants to merge
8
commits into
develop
Choose a base branch
from
fix-minseok/refreshIssue
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-반응형 최대 너비 680px -기본 너비 100%
-모든 파일 적용 완료 -화면 이외 다른 컴포넌트에는 적용 되지 않음
새로고침시 백엔드로 redirection 요청이 잘못가던 오류 해결하기 위해서 vite.config.js (localhost의 redirection설정) /public/_redireciton(netlify의 redirection설정)파일 수정
✅ Deploy Preview for itpick ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
clicelee
changed the title
[DESIGN/#159] 새로고침 오류(redirection) 해결
[FIX/#159] 새로고침 오류(redirection) 해결
Nov 19, 2024
[DESIGN/#156] 반응형 화면으로 전환
새로고침시 백엔드로 redirection 요청이 잘못가던 오류 해결하기 위해서 vite.config.js (localhost의 redirection설정) /public/_redireciton(netlify의 redirection설정)파일 수정
…ix-minseok/refreshIssue
yskim6772
approved these changes
Dec 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 ~~ 최고 !! 🤩
const response = await axios.get('/rank/main-keywords', { | ||
|
||
}); | ||
const response = await axios.get('/api/rank/main-keywords', {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 식으로 다 수정해야겠군요!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
새로고침시 백엔드로 redirection 요청이 잘못가던 오류 해결하기 위해서 vite.config.js (localhost의 redirection설정) /public/_redireciton(netlify의 redirection설정)파일 수정
기존의 redirection 설정은 다음과 같이 되어있었음
그렇게 되면 문제가 생기게 됨
새로고침을 할 경우 url로 라우팅 설정에 의해서
itpick.netlify.app/ranking
이라는 요청을 보내게 됨그렇게 될 경우 redirection 설정이
https://itpick.netlify.app/ranking
이라는 것을https://itpick.store/ranking
으로 rediretion을 하게 되어서다음과 같이 백엔드로 요청을 보내고 받는 response결과가 웹 브라우저 화면상에 나타나게 돼있음
우리가 원하던 것은 백엔드 요청(예시,
https://itpick.netlify.app/auth/login
와 같은 요청만) 백엔드 url로 redirection(https://itpick.store/auth/login
)을 원했던 것임즉 위에서 말했던 라우팅을 위한 요청
itpick.netlify.app/ranking
에 대해서는 그냥index.html
을 반환해주면 react가 화면 보여줄 것임결론, 그래서 백엔드 요청을 보낼때만 url 앞에
/api
를 붙여주기로 한다.다음 화면을 보면
proxy를 통해서 요청에
api
가 붙은 요청은itpick.store로 redirection을 해줄 것인데, redirection을 할 때는
api
를 다시 때서 백엔드 서버로 요청을 한다예로 들자면,
https://itpick.netlify.app/api/auth/login
로 요청을 보낸다면https://itpick.store/auth/login
로 요청을 바꿔서 보내겠다는 의미이다.그렇게 되면 기존의 새로고침하는 요청
https://itpick.netlify.app/ranking
과 같은 요청은 redirection 문법에 해당하지 않아서 index.html로 반환될 것임✅ 𝗖𝗵𝗲𝗰𝗸-𝗟𝗶𝘀𝘁
📌 𝗜𝘀𝘀𝘂𝗲𝘀
📎𝗪𝗼𝗿𝗸 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻
📷 𝗦𝗰𝗿𝗲𝗲𝗻𝘀𝗵𝗼𝘁
💬 𝗧𝗼 𝗥𝗲𝘃𝗶𝗲𝘄𝗲𝗿𝘀