Using Breeze using a WebApi service from another domain

How can I use an existing webapi service with breezes? Please note that my webapi service is on "server1 / api" and the web application is on "server2". I tried changing the service name in the dataservice, but getting XMLHttpRequest Exception 101. This is a cross-domain error. Is it possible to use the breeze using the webapi service from another domain?

+5
source share
1 answer

Breeze Cross-origin Applications

Yes, you can get the Breeze client application from one server and associate the Breeze application with a data service hosted on another server.

Breeze - CORS-supportive, CORS.

CORS . . CORS + Breeze Cool Breezes - Breeze.


: 10 2013 .

CORS, , - API2. , " CORS ASP.NET Web API 2" , CORS Web API2 CORS.

.


Todo CORS

Todo Sample. CORS, todo.breezejs.com, , jsFiddle Breeze Todo .

:

  • App_Start/ BreezeSimpleCorsHandler.cs

  • App_Start/ BreezeWebApiConfig.cs

// CORS enabled on this server
GlobalConfiguration.Configuration.MessageHandlers.Add(new BreezeSimpleCorsHandler());

, .

+14

All Articles