Closed saitonakamura closed 2 years ago
Like this?
// https://github.com/yandeu/five-server/blob/main/client/injected.ts
const script = document.querySelector('[data-id="five-server"]') as HTMLScriptElement
const protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'
- const address = `${protocol}${new URL(script.src).host}${window.location.pathname.replace(/\/+$/gm, '/fsws')}`
+ const address = `${protocol}${new URL(script.src).host}/fsws`
Yeah. Cause maybe I'm missing something
I can't remember why I did this. All tests are passing.
Fixed in #32
@yandeu thanks! Would be so kind and release it to npm?
Done
Great, ty!
Describe the bug When route doesn't end with
/
(say/my/route
), this line doesn't replace it with/fwsw
. I also don't understand what is the idea behind replacing part of pathname instead of just using/fsws
after the host