Nhowka / Elmish.Bridge

Create client-server Fable-Elmish apps keeping a single mindset
MIT License
139 stars 17 forks source link

Endpoint location is not relative #12

Closed grishace closed 6 years ago

grishace commented 6 years ago

When relative endpoint location is specified in Program.withBridge call, it is not relative during the runtime.

Consider the scenario, when app is developed locally as standalone - i.e. all routes are root-based, but deployed to IIS as a virtual app under some folder.

Here the endpoint location with the existing path info is being replaced with the one passed with the bridge configuration.

Maybe it would be better to do this instead? url.pathname <- url.pathname + this.path

Nhowka commented 6 years ago

That's not always desirable because it could be used with a different path that gives information to Elmish when using the navigator module, making the path to the socket wrong on those situations. I just pushed an update to give it more control about using a relative or even a real absolute path if needed. The README was updated as well.

grishace commented 6 years ago

Thank you!