From 1a0fd475b2e1e95cd01d3c6301cfe54ca607a8a5 Mon Sep 17 00:00:00 2001 From: Unitech Date: Sun, 29 Jan 2017 19:01:39 +0100 Subject: [PATCH] (serve) better stuff --- lib/API/Extra.js | 7 ++++--- lib/keymetrics.bkcp | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 lib/keymetrics.bkcp diff --git a/lib/API/Extra.js b/lib/API/Extra.js index 92089942..3cc62ec9 100644 --- a/lib/API/Extra.js +++ b/lib/API/Extra.js @@ -270,20 +270,21 @@ module.exports = function(CLI) { var filepath = path.resolve(path.dirname(module.filename), './Serve.js'); - if (!opts.name) + if (!opts.name || typeof(opts.name) == 'function') opts.name = 'static-page-server(' + servePort + ')'; if (!opts.env) opts.env = {}; opts.env.PM2_SERVE_PORT = servePort; opts.env.PM2_SERVE_PATH = servePath; + opts.cwd = servePath; this.start(filepath, opts, function (err, res) { if (err) { Common.printError(cst.PREFIX_MSG_ERR + 'Error while trying to serve : ' + err.message || err); - return cb ? cb(err) : that.exitCli(cst.ERROR_EXIT); + return cb ? cb(err) : that.speedList(cst.ERROR_EXIT); } Common.printOut(cst.PREFIX_MSG + 'Serving ' + servePath + ' on port ' + servePort); - return cb ? cb(null, res) : that.exitCli(cst.SUCCESS_EXIT); + return cb ? cb(null, res) : that.speedList(); }); } diff --git a/lib/keymetrics.bkcp b/lib/keymetrics.bkcp new file mode 100644 index 00000000..728be8b1 --- /dev/null +++ b/lib/keymetrics.bkcp @@ -0,0 +1,25 @@ + + ------------- + + Looking for a complete monitoring and management tool for PM2? + _ _ _ _ + | | _____ _ _ _ __ ___ ___| |_ _ __(_) ___ ___ (_) ___ + | |/ / _ \ | | | '_ ` _ \ / _ \ __| '__| |/ __/ __| | |/ _ \ + | < __/ |_| | | | | | | __/ |_| | | | (__\__ \_| | (_) | + |_|\_\___|\__, |_| |_| |_|\___|\__|_| |_|\___|___(_)_|\___/ + |___/ + + Features + + - Real Time Dashboard + - CPU/Memory monitoring + - HTTP monitoring + - Event notification + - Custom value monitoring + - Real Time log display + + Checkout + + https://keymetrics.io/ + + -------------