I have two dedicated projects "MyWeb" and "MyAPI", MyWEB is a site with one page with one controller and one view, it is based on MVVM knockout and ajax requests for MyAPI web application, it contains these two projects in different applications . I have included MiniProfiler with the MyWEB website and it works well, but I see only the first download results on the main page, and then all the data is downloaded from the MyAPI web application. So, I need to integrate MiniProfiler with the MyAPI project so that I can see the results of miniprofiler on the MyWEB website page. I know that MiniProfiler sends ajax requests to get the results, but I donβt understand why these requests work only with the same domain. For example, MyWEB is located in the domain http://mywebsite.com , and I send requests to MyAPI in the domain http://mywebapi.com/api , also these two projects can be hosted on two different computers. So what have I got during this time
Myweb global.asax
public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { MiniProfilerEF6.Initialize(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AreaRegistration.RegisterAllAreas(); } protected void Application_BeginRequest(object sender, EventArgs e) { } protected void Application_EndRequest() { } }
MyAPI global.asax
public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { MiniProfilerEF6.Initialize(); GlobalConfiguration.Configure(WebApiConfig.Register); AreaRegistration.RegisterAllAreas(); } protected void Application_BeginRequest(object sender, EventArgs e) { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); } }
MyAPI handlers web.config
<handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> <remove name="MiniProfiler"/> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" /> </handlers>