sm 기술 블로그

프론트 파일 배포 본문

AWS

프론트 파일 배포

sm_hope 2022. 10. 30. 17:52

git을 통해 프론트 파일을 가지고 오자.

git colne repository

혹은

git init
git config user.name
git config user.email
git remote add origin

초기화를 한 것이다.

 

만약 git에 프론트와 백 함께 들어가 있다면

https://smhope.tistory.com/585?category=1059981 

 

[Git] 일부 폴더만 pull/push 하기

문제 발생 프로젝트 프론트와 백을 하나의 디렉토리에 넣어놔 프론트만 혹은 백만 폴더를 받고 싶을 때 어떻게 할지 고민함. 다음과 같은 구조다. 문제 해결 git config core.sparseCheckout true echo "{특

smhope.tistory.com

를 참고하자.

 

 

back 과 front를 가져왔으며 준비는 끝났다.

 

다음 curl이 있는지 확인해보자

이러면 있는 것이다.

만약 없다면,

sudo apt install curl

해서 설치를 해주자.

 


curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

위 구문을 통해 nvm을 설치하는 것이다.

 

source ~/.profile

을 해주면 nvm 설치는 끝이다.

 

다음

nvm install --lts

를 통해 lts 버전의 nvm을 다운 받는다.

 


npm 설치

프론트 폴더로 넘어가서,

npm i

를 입력하여 npm을 설치하자.

 

그리고

npm run build

를 하면 

serve 어찌고를 깔라고 할 것이다.

 

npm i -g serve

 

serve -s build

를 입력하면 배포가 완료된다.

Comments