Как я могу маршрутизировать "/.well-known/apple-app-site-association" в ядре ASP.net?

Какой правильный синтаксис для создания маршрута в ядре ASP.NET?

        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}");
        });

1 ответ

Это делает трюк

      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?}");

        });
Другие вопросы по тегам