diff options
| author | Henry Jameson <spam@hjkos.com> | 2021-01-13 21:28:34 +0200 |
|---|---|---|
| committer | Henry Jameson <spam@hjkos.com> | 2021-01-13 21:28:34 +0200 |
| commit | 835eaf33b194b25c41ed24815e6e5cd5eb4570cd (patch) | |
| tree | 27e86b8875c2d88c64d3016d2f867c6d8f94092f | |
| parent | 8c82bb61f1a3fa2e8d9d57b00fa5bf66b0577f31 (diff) | |
fix local dev websockets
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | config/index.js | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7164eb26..0c8d4c19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Follows/Followers tabs on user profiles now display the content properly. - Handle punycode in screen names +- Fixed local dev mode having non-functional websockets in some cases ## [2.2.2] - 2020-12-22 ### Added diff --git a/config/index.js b/config/index.js index ccec4196..7cb87c3b 100644 --- a/config/index.js +++ b/config/index.js @@ -3,6 +3,11 @@ const path = require('path') let settings = {} try { settings = require('./local.json') + if (settings.target && settings.target.endsWith('/')) { + // replacing trailing slash since it can conflict with some apis + // and that's how actual BE reports its url + settings.target = settings.target.replace(/\/$/, '') + } console.log('Using local dev server settings (/config/local.json):') console.log(JSON.stringify(settings, null, 2)) } catch (e) { |
