diff --git a/packages/unleash-server/package.json b/packages/unleash-server/package.json index 9584239462..21c1f07c70 100644 --- a/packages/unleash-server/package.json +++ b/packages/unleash-server/package.json @@ -24,6 +24,9 @@ "node": "6" }, "main": "./server.js", + "bin": { + "unleash": "NODE_ENV=production ./unleash.js" + }, "scripts": { "db-migrate-and-start": "npm run db-migrate && npm run start", "start": "NODE_ENV=production node server-impl.js", @@ -31,10 +34,9 @@ "test:ci": "npm run test" }, "dependencies": { + "commander": "^2.9.0", "unleash-api": "1.0.0-alpha.2", "unleash-frontend": "1.0.0-alpha.2" }, - "devDependencies": { - - } + "devDependencies": {} } diff --git a/packages/unleash-server/unleash.js b/packages/unleash-server/unleash.js new file mode 100755 index 0000000000..c73c25f004 --- /dev/null +++ b/packages/unleash-server/unleash.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +'use strict'; + +const program = require('commander'); +const unleash = require('./server.js'); + + +program + .command('start', 'start unleash server') + .command('migrate', 'migrate the unleash db') + .option('-d, --databaseUri ', 'The full databaseUri to connect to, including username and password') + .parse(process.argv); + +unleash.start({ databaseUri: program.databaseUri });