1.0.14 • Published 7 years ago
huang_cheng4 v1.0.14
#Tars发布Node应用文档
创建
scripts
文件夹,并创建2个sh文件创建
startup.sh
``` #!/bin/sh cd /opt/tars/apps/100001954/current pm2 start app.js --name appName ```
创建
shutdown.sh
``` #!/bin/sh pm2 show appName if [ $? -eq 0 ]; then pm2 delete appName fi ```
应用启动端口会配置在
package.json
文件夹中"config":{ "port": 80 }
如果使用了configgen,需要使用gulp将tpl文件生产各个环境的配置文件,添加
gulpfile.js
、configtpl.js
,配置config.profile.js
文件。