mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

Is it possible to change the base URL for `/ngapimock/*` calls? #74

Open galanovnick opened 5 years ago

galanovnick commented 5 years ago

Is it possible to change the base URL for /ngapimock/* calls without using any proxy? In most of the examples, we use proxy to redirect all these calls to our actual API server.

"/ngapimock/*": {
    "target": "http://localhost:9090",
    "secure": false,
    "logLevel": "debug"
  }

But such approach forces us to push all other API calls through the same proxy because otherwise, as far as I understand, the cookie (or session id?) will differ so selectScenario won't have any effect.

So if for example, we have our UI hosted on the port 4200 and API server on 9090 we can't change any scenario because the cookie is set to 4200 and not to 9090. Does it mean that our UI is limited to http://localhost:4200/* for API calls? And what if UI is already using http://localhost:9090/* and requires no proxy?

mdasberg commented 4 years ago

I have a task on the backlog to make this configurable in the new version.

https://github.com/ng-apimock/base-client/issues/5