diff --git a/README.md b/README.md index a5503b6..7783f63 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,11 @@ A simple RESTful API of GPT-4 / ChatGPT with Azure OpenAI Service, build with Ty ## Features - Base on Azure OpenAI Service REST API -- Simple, easy to use, one endpoint only -- Flexible for future extension and development +- One endpoint for simple usage +- Flexible and easily extensible for future development - Logit bias & function call are not supported yet - RESTful API structure +- Ready for use with PM2 - Build with TypeScript, Node.js, Express --- diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..c2b953c --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,14 @@ +module.exports = { + apps : [{ + name : "azure-gpt-api", + script: 'dist/', + watch: true, + watch_delay: 1000, + watch : "dist", + // ignore_watch : ["node_modules"], + exec_mode: "cluster", + instances: 4, + max_memory_restart: "1G", + log_date_format: "YYYY-MM-DD HH:mm:ss Z", + }] +}; \ No newline at end of file diff --git a/package.json b/package.json index d3a8ad7..0b36d27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azure-openai-chatgpt-api", - "version": "1.0.0", + "version": "1.0.1", "description": "Simple RESTful API of GPT-4/ChatGPT with Azure OpenAI Service for testing and internal use", "main": "dist/index.js", "homepage": "https://github.com/jasonfoknxu/azure-openai-chatgpt-api", @@ -10,7 +10,10 @@ "scripts": { "start": "node dist/index.js", "build": "tsc -p tsconfig.json", - "test": "yarn start test" + "test": "yarn start test", + "pm2": "pm2 start ecosystem.config.js", + "pm2:bg": "pm2 start ecosystem.config.js --no-daemon", + "pm2:update": "pm2 startOrReload ecosystem.config.js" }, "devDependencies": { "@types/compression": "^1.7.2",