I have a problem using breeze on a project based on John Papa's HotTowel. I configured breeze like:
var mgr = new breeze.EntityManager('breeze/Breeze');
everything is ok but in the case I change the Project properties Start Action
from Current Page
to Specific Page: HotTowel/Index
and breeze doesn't work properly.
I've checked the requests using firebug. It seems in this case application sends a GET
request like this:
http://localhost:53180/HotTowel/Index/breeze/Breeze/Metadata
instead of
http://localhost:53180/breeze/Breeze/Metadata
I've also checked this part of breeze.js
which is going to send get request.
The url
parameter is set to breeze/Breeze/Metadata
in both cases which seems correct.
ctor.prototype.fetchMetadata = function (metadataStore, dataService) {
var serviceName = dataService.serviceName;
var url = dataService.makeUrl("Metadata");
var deferred = Q.defer();
var that = this;
ajaxImpl.ajax({
url: url,
dataType: 'json',...
I've also tried ~/breeze/Breeze
but it didn't work as remote service name.
As I'm new to web, probably it's not related to breeze. The question is why the ajax call (or breeze) depends on how the project activates?
The reason why this happens is because you specified a relative path for the EntityManager and if your url is localhost:53180/HotTowel/Index then the relative url for the EntityManager is localhost:53180/HotTowel/Index + /breeze/Breeze.
To correct the issue, change your EntityManager path to the following:
Add a
/
character to your configuration to execute the request relative to the base directory: