@shun-js/shun-cli
v1.0.6
Published
shun.js cli
Readme
@shun-js/shun-cli
shun.js cli tool
Install
npm i -g @shun-js/shun-cliStart servers
# start a server (version is required), run in the directory containing config json files
shunjs start @shun-js/[email protected]
# start multiple servers
shunjs start @shun-js/[email protected] @shun-js/[email protected]Config
Config files are JSON files in the working directory named {name}.json (e.g. user.json).
Single instance
{
"port": 8003,
"db": {}
}Multiple instances
When a config file contains an array, each element starts as a separate pm2 process. Use pm2Name to set the process name (falls back to {name}-{index}).
[
{ "port": 8003, "pm2Name": "user-api", "db": { "database": "db_user" } },
{ "port": 8013, "pm2Name": "user-internal", "db": { "database": "db_user2" } }
]