From e4efdfe0e7df03f01e752f9556dc98ca5c0fff18 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Tue, 29 Apr 2025 18:34:13 +0800 Subject: [PATCH] fix --- ecosystem.config.mjs | 13 +++++++++++++ package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ecosystem.config.mjs diff --git a/ecosystem.config.mjs b/ecosystem.config.mjs new file mode 100644 index 0000000..fed7c9b --- /dev/null +++ b/ecosystem.config.mjs @@ -0,0 +1,13 @@ +const PORT = 5006; +module.exports = { + apps: [ + { + name: 'xhs-api-server', + script: 'server.py', // 替换为您的Python脚本路径 + interpreter: 'python', // 替换为您的Python解释器路径 + env: { + XHS_API_PORT: PORT // 从环境变量获取端口,不存在则使用5005 + }, + } + ] +}; diff --git a/package.json b/package.json index 97eee29..3445a20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/social-xhs-api-server", "scripts": { - "start": "node index.js" + "start": "pm2 start ecosystem.config.mjs" } } \ No newline at end of file