Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setPort(env) {
var basePort = config.get(`PORTS.${env['ADAPTER']}`)
return portscanner.findAPortNotInUseAsync(basePort, basePort + 50, '127.0.0.1')
.then((port) => {
env['PORT'] = port
log.debug(`Set ${env['ADAPTER']} PORT: ${port}`)
return env
})
}