2016-09-05 3 views
2

ASP.NET 코어에서 경로를 만드는 올바른 구문은 무엇입니까?ASP.net 코어에서 "/.well-known/apple-app-site-association"을 어떻게 라우트 할 수 있습니까?

 app.UseMvc(routes => 
     { 
      routes.MapRoute(
       name: "default", 
       template: "{controller=Home}/{action=Index}/{id?}"); 

      routes.MapRoute(
       name: "Handoff-iOS9", 
       //url: ".well-known/apple-app-site-association", 
       template: "{controller=Home}/{action=WellKnownAppleHandoff}"); 

      routes.MapRoute(
       name: "ApplePay", 
       //url: ".well-known/apple-developer-merchantid-domain-association", 
       template: "{controller=Home}/{action=WellKnownApplePay}"); 
     }); 

답변

4

이 트릭

 app.UseMvc(routes => 
     { 
      routes.MapRoute(
       name: "Handoff-iOS9", 
       template: ".well-known/apple-app-site-association", 
       defaults: new { controller = "Home", action = "WellKnownAppleHandoff" }); 

      routes.MapRoute(
       name: "ApplePay-MacOS", 
       template: ".well-known/apple-developer-merchantid-domain-association", 
       defaults: new { controller = "Home", action = "WellKnownApplePay" }); 

      routes.MapRoute(
       name: "default", 
       template: "{controller=Home}/{action=Index}/{id?}"); 

     }); 
을 수행