Breeze.js 示例显示的客户端代码如下:
breeze.config.initializeAdapterIntance("dataService","mongo", true);
var manager = new breeze.EntityManager(serviceName: "breeze/xyz")
不知何故,微风必须弄清楚获取元数据的正确 URL 是http://localhost:8888/breeze/xyz/Metadata
. 但是按照上面的配置,这对我来说失败了:"Metadata query failed for blink/xyz/Metadata"。它失败了,因为 jQuery 正在发出:
GET file:///C:/dev/xyz/public/breeze/xyz/Metadata
为了使它工作,我必须做的是:
breeze.config.initializeAdapterInstance("dataService","mongo", true);
serviceName = "http://localhost:8888/breeze/xyz";
var mongoDataService = new breeze.DataService({
serviceName: serviceName,
adapterName: "mongo",
hasServerMetadata: true
});
var store = new breeze.MetadataStore();
var manager = new breeze.EntityManager({
serviceName: serviceName,
dataService: mongoDataService,
metadataStore: store
});
有没有办法配置微风客户端,让它知道http://localhost:8888/
在服务名称前添加?