From cb72c300ec0e6f6640fe9383338d9084bb734510 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pm2=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pm2_dev.sh | 2 +- start_test.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pm2_dev.sh b/pm2_dev.sh index 79188c1..1012fd6 100755 --- a/pm2_dev.sh +++ b/pm2_dev.sh @@ -1 +1 @@ -pm2 start npm --name "web-task-svr" --log-date-format "YYYY-MM-DD HH:mm:ss" -- run "dev:api" \ No newline at end of file +pm2 start ts-node --name "task:api" --log-date-format "YYYY-MM-DD HH:mm:ss" -- -r ./node_modules/tsconfig-paths/register ./src/api.ts \ No newline at end of file diff --git a/start_test.json b/start_test.json index e3dd7e1..e9e47c8 100644 --- a/start_test.json +++ b/start_test.json @@ -1,9 +1,8 @@ { "apps": [ { - "name": "web-task-svr", - "script": "npm", - "args": "run prod:api", + "name": "task-api", + "script": "./dist/api.js", "cwd": "/root/code/task-svr", "max_memory_restart": "1024M", "log_date_format": "YYYY-MM-DD HH:mm Z", @@ -12,7 +11,8 @@ "instances": 1, "exec_mode": "fork", "env": { - "NODE_ENV": "development" + "NODE_ENV": "development", + "NODE_PATH": "./dist" }, "env_production": { "NODE_ENV": "development"