PM2 in depth_PM2PM2 in depth,PM2,node.js, DevOps, sequelize, ORM ecosystem.config.js



PM2 in depth

ecosystem.config.js

module.exports = {
apps : [{
name: "app",
script: "./app.js",
env: {
NODE_ENV: "development",
},
env_production: {
NODE_ENV: "production",
}
}]
}
# $ pm2 [start|restart|stop|delete] ecosystem.config.js

$ pm2 start ecosystem.config.js

PM2 in depth_PM2

PM2

$ yarn global add  pm2
# OR
$ npm install pm2 -g

# global
$ pm2 start server/index.js
$ yarn add -D pm2
# OR
$ npm i -D pm2

# local
$ ./node_modules/pm2/bin/pm2 start server/index.js

$ ./node_modules/pm2/bin/pm2 list

# $ ./node_modules/pm2/bin/pm2 stop ID
$ ./node_modules/pm2/bin/pm2 stop 0

$ ./node_modules/pm2/bin/pm2 monit


PM2 in depth_PM2_03

sequelize

ORM

Object Relational Mapping 对象关系映射

Table => Object, 简化 SQL 查询命令的编写

PM2 in depth_PM2 in depth_04