Files
shields/lib/in-process-server-test-helpers.js
Paul Melnikow fa5309400d PaaS, CI, and production-friendly config (#2626)
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv).

`private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.
2019-01-06 10:42:09 -05:00

24 lines
373 B
JavaScript

'use strict'
const Server = require('./server')
const config = require('config').util.toObject()
function createTestServer({ port }) {
const serverConfig = {
...config,
public: {
...config.public,
bind: {
...config.public.bind,
port,
},
},
}
return new Server(serverConfig)
}
module.exports = {
createTestServer,
}