VROOM-Project / vroom-express

Out of the box Node-express server to use VROOM as a web API.
BSD 2-Clause "Simplified" License
70 stars 59 forks source link

Include router url in request body #98

Open answerquest opened 1 year ago

answerquest commented 1 year ago

Hi, thanks a lot for making this really efficient API wrapper around Vroom .

I have multiple routers setup for multiple regions and use cases, and want to be able to use the same vroom-docker / vroom-express instance, by sending in the host and port of the router in my api request.

I've gone through the source code (just 2 files, thank heavens!) and I'm thinking this is how we can do it:

I reckon something similar is already being done with "options" (g, c etc).

How does this sound?

jcoupey commented 1 year ago

What you want to do is basically to override the default host/port config so this is indeed very similar to what is provided for other flags via the options object.

If you simply replicate the way it's done for other options, you could add support for -a and -p flags in options.a and options.p respectively, which would be enough. Happy to review a PR for such a change.