szjcomo b9b032cd9b 增加单点登录和更新用户登录状态 | 2 months ago | |
---|---|---|
.vscode | 4 months ago | |
public | 2 months ago | |
src | 2 months ago | |
test | 1 year ago | |
.editorconfig | 1 year ago | |
.eslintrc.json | 1 year ago | |
.gitignore | 2 months ago | |
.modelconfig.json | 2 months ago | |
.prettierrc.js | 1 year ago | |
README.md | 2 months ago | |
README.zh-CN.md | 1 year ago | |
bootstrap.js | 11 months ago | |
jest.config.js | 1 year ago | |
package-lock.json | 2 months ago | |
package.json | 2 months ago | |
pmrun.config.js | 2 months ago | |
tsconfig.json | 1 year ago |
see midway docs for more detail.
$ npm i
$ npm run dev
$ open http://localhost:port/
$ npm start
npm run lint
to check code style.npm test
to run unit test. {
name: "xxx",
script: "./bootstrap.js",
instances: 1,
exec_mode: "cluster",
env: {
"NODE_ENV": "xxx",
"DB_NAME":"xxx", //MYSQL 数据库名称
"MYSQL_UNAME":"xxx", //MYSQL 账号
"MYSQL_PWD":"xxx", //MYSQL 密码
"MYSQL_HOST":"192.168.18.67", //MYSQL 地址
"MYSQL_PORT":3306, //MYSQL 端口号
"POOL_MAX":5, //MySQL 最大连接池数量
"POOL_MIN":1, //mysql 最小链接池数量
"REDIS_PORT":6379, //redis 端口
"REDIS_HOST":"192.168.18.67", //redis 地址
"REDIS_PWD":"xxx", //redis 密码
"REDIS_DB":1, //redis 数据库索引
"APP_PORT":6379, //项目端口
"GLOBALPREFIX":"xxx", //项目前缀
"BULL_BOARD":"/xxx/uilist", //项目任务队列的访问地址 如http://域名/BULL_BOARD配置项,
"STATIC_PATH":"/static", //动态的服务器静态文件访问前缀
"APP_LIMITER":10, //接口请求限流大小
"WRITE_LOG":true, //是否需要写入管理员操作日志
"ACTION_LOG_WRITE":10, //管理员操作日志写入时机,有10条就写入吧 只有当WRITE_LOG = true有效
}
}
pm2 start pmrun.config.js --name xxx //根据上方的配置按需要启动