Study/Node, React 기초 강의_John Ahn
Nodemon
d-_-s
2023. 2. 14. 00:14
Nodemon이란?
소스를 변경할 때 그걸 감지해서 자동으로 서버를 재 시작해주는 툴이다.
Visual Studio Code의 콘솔창에 명령어를 입력해 Nodemon을 설치한다.
npm install nodemon --save-dev
< 결과 >

Nodemon을 이용하여 index.js를 실행하기 위해 package.json에 코드를 추가한다.
{
"name": "boilerplate",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"backend": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "d-_-s",
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.1",
"express": "^4.18.2",
"mongoose": "^6.9.1"
},
"devDependencies": {
"nodemon": "^2.0.20"
}
}