본문 바로가기

nextjs6

마지막) vercel에 무료로 배포하기 여기까지 완료했다면 이제 웹상에서 내 프로젝트를 볼 수 있도록 배포해보자 배포를 하는 방법은 여러가지가 있는데 next js는 쉽게 배포를 할 수 있는 vecel과 연동을 제공한다 https://vercel.com/ Develop. Preview. Ship. For the best frontend teams – Vercel Deploy web projects with the best frontend developer experience and highest end-user performance. vercel.com 해당 홈페이지에 로그인이 완료됐다면 다음과 같은 화면이 뜰것이다. import project를 클릭하자 기본값으로 셋팅하고 next.js가 선택되어있는지 확인한 후 deploy를 시작한다. 배.. 2020. 8. 1.
7) styled-components 적용하기 데이터를 긁어오고 화면에 표시하는 작업까지 완료되었다. 이제는 styled-components로 이쁘게 바꾸어보자. styled-components를 프로젝트에 적용하기위해서는 몇가지 설정이 필요하다. 먼저 yarn으로 패키지를 설치해보자 yarn add styled-components 설치가 완료되면 pages폴더에 _document.js파일을 생성한다. import Document from 'next/document' import { ServerStyleSheet } from 'styled-components' export default class MyDocument extends Document { static async getInitialProps(ctx) { const sheet = new Se.. 2020. 8. 1.
4)날짜 처리하기 date-fns 앞서 코로나 바이러스 API를 살펴보니 날짜라는것이 필요해졌다. 자바스크립트에서는 날짜를 다음처럼 처리한다. var date = new Date(); //Thu Jul 16 2020 23:27:34 GMT+0900 (Korean Standard Time) 이런식으로 생성하는데 2020-07-16으로 포맷을 일일이 바꿔주는것은 상당히 귀찮은 일이다. node에는 여러가지 날짜를 처리하는 라이브러리들이 있는데 이중에서 date-fns라는 라이브러리를 사용해보겠다. https://date-fns.org/ Modern JavaScript Date Utility Library date-fns provides the most comprehensive yet simple and consistent toolset fo.. 2020. 7. 16.
2)github에 내 프로젝트 등록하기 https://github.com Build software better, together GitHub is where people build software. More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects. github.com Hello world까지 작성한 내 프로젝트를 원격 저장소인 github에 올려보자. 회원가입을 했다는 가정하에 new아이콘을 클릭해서 저장소인 repository를 생성하자 하고 싶은 이름을 아무거나 입력하고 Create repository 클릭! 영어가 가득한 화면이 뜰텐데 우리는 다시 VS code로 돌아가자. echo "# covidwor.. 2020. 7. 15.