Closed sarg3nt closed 9 years ago
This must be a matching issue when it is determining if it can batch a http request. Let me check this.
This seems to be working in the test application?
https://github.com/jonsamwell/angular-http-batcher/blob/master/tests/index.html#L34
app.config([
'httpBatchConfigProvider',
function (httpBatchConfigProvider) {
httpBatchConfigProvider.setAllowedBatchEndpoint(
'http://localhost:8080',
'http://localhost:8080/api/batch', {
batchRequestCollectionDelay: 500,
minimumBatchSize: 2
});
}
]);
I blew about three hours trying to figure out why the batcher wasn't working after first installing it in our code base. I followed the initial setup to a tee and confirmed the Web API was working as expected. I ended up creating a whole separate Angular app to test it and still couldn't get it to work until I switched the absolute URL's shown in the demo to relative ones. Once I did that, it began to work. Does not work:
Works:
I'm totally OK with the relative paths, it's really what I wanted anyway but was trying to replicate the exact setup as shown in the instructions to get it up and running. I don't know if this is a bug in the code base or not, but changing the instructions would be very helpful.
Thanks!