노드 리액트 기초 강의 #24 Concurrently

라따뚜이·2021년 11월 11일
0

프론트, 백 서버를 한꺼번에 실행시켜 어플리케이션을 실행시켜보자.

1. Concurrently를 설치한다.

npm i concurrently

2. 서버 package.json 수정한다.

npm에 사용법 기재가 되어있다.

"start": "concurrently \"command1 arg\" \"command2 arg\""

  "scripts": {
    "start": "node index.js",
    "backend": "nodemon index.js",
    "test": "echo \"Error: no test specified\" && exit 1",
  }

start는 이미 있기 때문에 dev로 추가해준다.


  "scripts": {
    "start": "node index.js",
    "backend": "nodemon index.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev" : "concurrently \"npm run backend\" \"npm run start --prefix client\""
  }

--prefix는 디렉토리를 명시해주는 명령어인거 같다.

profile
돈만 준다면 해 노예

0개의 댓글