Skip to content

Commit

Permalink
add stop script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandan Sridhar committed Jun 23, 2017
1 parent 50aea84 commit 5d2ab79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"scripts": {
"start": "node app.js",
"stop" : "node stop.js",
"package": "node cli/package.js",
"test": "mocha --timeout 17000 tests"
},
Expand Down
16 changes: 16 additions & 0 deletions stop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

var run = require('./cli/lib/gateway')();
const os = require('os');

const options = {};

options.env = process.env.EDGEMICRO_ENV;
options.key = process.env.EDGEMICRO_KEY;
options.secret = process.env.EDGEMICRO_SECRET;
options.org = process.env.EDGEMICRO_ORG;
options.configDir = process.env.EDGEMICRO_CONFIG_DIR;
options.processes = process.env.EDGEMICRO_PROCESSES || os.cpus().length;
options.port = process.env.PORT || 8000;

run.stop(options);

0 comments on commit 5d2ab79

Please sign in to comment.