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); + }, +};