npm install express-generator -D
express server cd server npm i
node bin/www
.DS_Store node_modules/ dist/ npm-debug.log* yarn-debug.log* yarn-error.log* test/unit/coverage test/e2e/reports selenium-debug.log # Editor directories and files .idea .vscode *.suo *.ntvs* *.njsproj *.sln
nodemonnode
全局安裝: npm install -g nodemon or 本地安裝: npm install --save-dev nodemon
在package.json 的scripts選項裏面添加git
"scripts": { "start": "node ./bin/www", "dev": "nodemon ./bin/www" },
此時啓動方式是:express
npm run dev
安裝 npm install supervisor -g 使用 supervisor bin/www
在package.json 的scripts選項裏面添加npm
"scripts": { "start": "node ./bin/www", "sup": "supervisor ./bin/www" },
此時啓動方式是:json
npm run sup
詳細使用方式請去官網jsp
pm2ide
npm install pm2 -g 啓動方式 pm2 start ./bin/www
在package.json 的scripts選項裏面添加優化
"scripts": { "start": "node ./bin/www", "pm2": "pm2 start ./bin/www" },
此時啓動方式是:idea
npm run pm2