fix: Update config to be flexible for host

This commit is contained in:
Mrugesh Mohapatra
2017-02-22 13:04:21 +00:00
parent d5db2803ad
commit 566de3e3f2
4 changed files with 11 additions and 4 deletions

View File

@@ -4,9 +4,12 @@ let trusted = [
"'self'"
];
const host = process.env.HOST || 'localhost';
const port = process.env.PORT || process.env.SYNC_PORT || '3000';
if (process.env.NODE_ENV !== 'production') {
trusted = trusted.concat([
'ws://localhost:3000'
`ws://${host}:${port}`
]);
}