들어가기
frontend의 개괄적인 구성방법을 알아본다.
크게
/components
/libs
/pages
세개의 folder로 구성된다.
NextJs는 rounter가 엄청나게 편하게 되어있다.
/Pages의 index.tsx부분이 localhost:3000 을 연결했을떄 열리는 화면이다.
그리고 /pages/enter.tsx 파일일
localhost:3000/enter 주소로 열리는 화면이다.
/pages/profile/index.tsx ==>localhost:3000/profie 주소로 열리는 page
/pages/profile/edit.tsx ===>localhost:3000/profile/edit 로 열리는 page
/pages/items/[id].tsx ==>localhost:3000/items/1,2,3 등등 id로 열리는 page
/components 폴더는 Layout이나 Button등등 여러 page에서 공통적으로 사용되는 component들을 담아둔다.
/lins에서는 page에서 사용될 function등을 담아둔다.
다음장에서는 components와 libs에 대해서 알아본다.