From db00cd0f686bac2efba952c323406781fee012cf Mon Sep 17 00:00:00 2001 From: emi Date: Thu, 16 Jul 2020 13:46:10 -0600 Subject: [PATCH] Add pm2 api config --- README.md | 2 +- src/api/api.config.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/api/api.config.js diff --git a/README.md b/README.md index 4ba0bae2..a897fe1d 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ pm2 start dist/services/blocks.config.js ### API ``` shell - node dist/api + pm2 start dist/api/api.config.js ``` ## Commands diff --git a/src/api/api.config.js b/src/api/api.config.js new file mode 100644 index 00000000..fdc7690b --- /dev/null +++ b/src/api/api.config.js @@ -0,0 +1,19 @@ +import config from '../lib/config' + +const cwd = `${__dirname}` +const name = 'explorer-api' +const script = 'index.js' +const { log } = config + +const conf = { script, name, cwd } + +if (log && log.dir) { + let { dir } = log + conf.error_file = `${dir}/${name}-error.log` + conf.out_file = `${dir}/${name}-out.log` +} + + +export const apps = [conf] + +console.log(apps) \ No newline at end of file