elm-reactor
elm-reactor copied to clipboard
Provide config for server url
I'm trying to integrate Elm with a Rails application. Elm-reactor runs on port 8000 and my Rails app in 3000. When embedding reactor it tries to connect to the sockets on the wrong port:
can't establish a connection to the server at ws://localhost:3000/socket?file=/client/One.elm.
I am using reactor as follows:
var app = Elm.fullscreenDebug('Two', '/client/Two.elm');
So we need some way to tell reactor where to find its server e.g.
var app = Elm.fullscreenDebug('Two', '/client/Two.elm', { host: 'localhost://8000'});
Noted, thanks for filing.
Maybe I'm misunderstanding the purpose here, but isn't elm-reactor --address=... --port=... doing what you want?
@jvoigtlaender the reactor server might be running in port 8000 as set by --port, but the JS might be running in a different port entirely when embedded in another application.
Thus we need some way of telling the JS where to find the reactor server. Now it just assumes that the server is in the same host where the JS is running and tries to connect to web sockets there.
Ah, yes, makes sense. Sorry for misunderstanding.