From 124799b20091bcd75c4a895a6070c7148e042650 Mon Sep 17 00:00:00 2001 From: Ivar Date: Wed, 28 Sep 2016 23:47:31 +0200 Subject: [PATCH] Allow options overides such as databaseUri --- packages/unleash-server/package.json | 2 +- packages/unleash-server/server-impl.js | 3 +++ packages/unleash-server/server.js | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 packages/unleash-server/server-impl.js diff --git a/packages/unleash-server/package.json b/packages/unleash-server/package.json index 79a90e4c1b..9584239462 100644 --- a/packages/unleash-server/package.json +++ b/packages/unleash-server/package.json @@ -26,7 +26,7 @@ "main": "./server.js", "scripts": { "db-migrate-and-start": "npm run db-migrate && npm run start", - "start": "NODE_ENV=production node server.js", + "start": "NODE_ENV=production node server-impl.js", "test": "echo 'TODO add server tests'; exit 0;", "test:ci": "npm run test" }, diff --git a/packages/unleash-server/server-impl.js b/packages/unleash-server/server-impl.js new file mode 100644 index 0000000000..8d7080fa7c --- /dev/null +++ b/packages/unleash-server/server-impl.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./server.js').start(); diff --git a/packages/unleash-server/server.js b/packages/unleash-server/server.js index 01e5cc748c..d01961a448 100644 --- a/packages/unleash-server/server.js +++ b/packages/unleash-server/server.js @@ -2,4 +2,10 @@ const unleash = require('unleash-api'); const { publicFolder } = require('unleash-frontend'); -unleash.start({ publicFolder }); + +module.exports = { + start: options => { + const opts = Object.assign({}, { publicFolder }, options); + return unleash.start(opts); + }, +};