본문 바로가기
  • Veritas vos liberabit
Coding/React

Cannot GET (express)

by Rouxist 2022. 8. 18.

와..

 

 

https://stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writing-manually

 

React-router URLs don't work when refreshing or writing manually

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want. For instance, I am in localhost/joblist and everything is fine

stackoverflow.com

 

아파치 써야 하는 줄

그 다음엔 해쉬라우터 써야 하는 줄 :

https://blog.joyfui.com/1220

 

결국 이걸 보고 해결 :

https://jerimo.github.io/express/cannot-get-error/

 

[Express] Cannot GET / 에러

💥 React 새로고침(또는 URL 직접 입력) 시에 Cannot GET / 에러 발생 프로젝트를 진행하던 중, 분명 프론트에서는 라우터를 지정해 주었는데 새로고침을 하면 404 NOT FOUND 에러가 발생하며 페이지가 뜨

jerimo.github.io

 

 

before
after

 

'Coding > React' 카테고리의 다른 글

큐뱃 개발 - 08/18, 08/19  (0) 2022.08.20
props.history.push() 안됨  (0) 2022.08.19
큐뱃 개발 - 2022.08.02  (0) 2022.08.04
MongoDB  (0) 2022.08.02
큐뱃 개발 - heroku 업로드  (0) 2022.08.01