git으로 배포
- yarn create react-app my-app 명령어를 사용하면 git이 이미 초기화 되어있음
- git remote add origin ~~ 를 통해 깃허브에서 만든 repository 원격 저장소와 내 로컬에 있는 폴더를 연결
- 그리고 추가된 파일이 있다면 git add * 하고 -> git commit -m "작업내용작성"
- git push 를 하면됨
=> 자동으로 깃과 연결이 되어서 깃허브에 로컬에서 작성한 코드가 올라감.
=> 문제가 생기면 open ~/.gitconfig를 열고 user 정보가 정확한지 확인할 필요가있음. 나의 깃허브 아이디가 잘 입력되어 있는지.
settings에 가고, github page를 master페이지로 저장.
=> 이때 나온 주소가 내가 얻게될 주소임
package.json에 이 주소를 입력해줌
yarn add gh-pages를 통해 추가.
npm run deploy => 배포 완료
등등을 통해 추가하면 됨(아래 링크 참고해도 도움됨)
https://www.hohyeonmoon.com/blog/react-js-github-pages-deploy/
React JS를 Github Pages에 호스팅하기 | Hohyeon Moon
React JS 라이브러리를 Github Pages에 호스팅하는 방법을 알아봅니다.
www.hohyeonmoon.com
React Deployment페이지를 보면서 따라하면 됨
Netlify로 배포
https://create-react-app.dev/docs/deployment/
->앨리 예제에선
publish folder ? build로 함
Deployment | Create React App
npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of the /st
create-react-app.dev
https://heropy.blog/2018/01/10/netlify/
GitHub와 Netlify를 이용한 쉽고 빠른 HTTPS 무료 호스팅
GitHub, GitLab 등과 계정 연동 및 쉬운 호스팅을 제공하는 PaaS 서비스로, Continuous Deployment, One-Click HTTPS 제공 등 고성능 사이트 / 웹 응용 프로그램을 제작하는데 필요한 쉽고 빠른 다양한 서비스들을
heropy.blog
*앨리의 드림코딩 복습
'[React] Front-End' 카테고리의 다른 글
[FE] React.js : useEffect 의 용도 / 사용 예시 (0) | 2021.06.09 |
---|---|
[FE] React : REST API (0) | 2021.05.24 |
[FE] React / ReactHooks (0) | 2021.05.17 |
[FE] React : 이벤트 처리하기 (0) | 2021.05.14 |
[FE] JS: map / React: State up, list key(react props로 넘길때 key값 지정) (0) | 2021.05.10 |