프론트, 백 서버를 한꺼번에 실행시켜 어플리케이션을 실행시켜보자.
npm i concurrently
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는 디렉토리를 명시해주는 명령어인거 같다.