nrenner / brouter-web

Web client for BRouter, a routing engine based on OpenStreetMap
https://brouter.de/brouter-web/
MIT License
361 stars 68 forks source link

Letting user overload the BR.conf.host #252

Open Phyks opened 4 years ago

Phyks commented 4 years ago

Hi,

I'm currently working on a small test suite (more like integration tests rather than unit tests) to help develop BRouter profiles (see https://github.com/abrensch/brouter/issues/116#issuecomment-539191685 for the full issue).

One thing that would be really nice is to be able to link to BRouter-Web (actually brouter.de/brouter-web) below each test case as this would provide a nice user interface to further debug. This link is already there, but not fully working since BRouter-web instance uses the default BRouter instance and not the "testing" one with a fixed set of segments files (fixed in time, for reproducibility).

What about adding an URL parameter to let user overload the BR.conf.host value? This way, the same brouter.de/brouter-web interface could be used for general usage and testing, just by appending a URL parameter.

Thanks!

nrenner commented 4 years ago

I think we wouldn't want to allow everybody to post links to our site with some arbitrary backend.

Will have a look to better understand the use case and what to do instead.

Phyks commented 4 years ago

I think we wouldn't want to allow everybody to post links to our site with some arbitrary backend.

Might be a backend whitelist?

nrenner commented 4 years ago

If there is a separate server installation, the most straightforward solution would be to also have a separate client matching the server version, with a distinct URL.

bagage commented 4 years ago

@Phyks do you think a test.brouter.xxx would be OK?

nrenner commented 4 years ago

Such a simple switch won't work.

The current test installation on brouter.de is a separate server installtion that needs a separate, matching client.

See abrensch/brouter#209 for a probably better way using the profile parameter forceSecondaryData as a switch.

bagage commented 4 years ago

@nrenner I meant installing a separate client on test.brouter.xxx (or even http://brouter.de/BrouterTesting-web/ that could be used in the tests - instead of using brouter.de/brouter-web webclient?

nrenner commented 4 years ago

abrensch would prefer using a single client & server installation (comment).

The proposed data switch as a profile flag could be supported in the client either by allowing to pass a custom profile id or by forwarding a profile parameter, that could be implemented like the other provisional parameters until we have a proper general implemenation.