실습중 client 와 server 를 각각 다른 포트를 사용해서 실행할 경우 2개의 서버를 기동해주어야했다.
concurrently 를 사용해서 해당 scripts를 설정해주면 동시에 기동이 가능하다.
1. concurrently install
npm install concurrently --save (루트에서)
2. scripts 작성
root 디렉토리의 package.json 의 scripts 부분에 dev 라는 스크립트를 추가해주고
맨 앞에 concurrently 선언해준뒤 실행명령어를 나열해주면 끝!
'javascript > React' 카테고리의 다른 글
[오류 해결] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??=' (0) | 2024.10.30 |
---|---|
[경고]Please use the 'setupMiddlewares' option. (0) | 2023.02.28 |
[오류 해결]internal/modules/cjs/loader.js:883 (0) | 2023.02.11 |
react-router-dom URL로 페이지 접근하기 (0) | 2023.02.10 |
React 200제(45~55번 실습) (0) | 2021.11.15 |