Open mike-suggitt opened 8 years ago
Hey could elaborate a bit on this, please? Where do you set the target at runtime?
Either how are you overriding the config file at runtime. Thanks!
Wow its been over 6 months since I raised this but i think what i meant is that the proxy was read in and held in a closure rather than continually checking the config/options object. With a small change that means it re-evaluates the object each time it would allow a dev to dynamically overwrite that value.
While I am aware that there has been work done for V3 to support dynamic proxying (https://github.com/BrowserSync/UI/issues/6) it would be great to have this supported in V2 asap.
As such I've seen a quite, relatively low impact solution that will allow devs to dynamically set the proxy target.
In
lib/server/proxy-server.js
simply make the following update:This allows a dev to dynamically change the proxy target using middleware specified in their configration