As per Apple's requirements for Universal Links, I have a file called "apple-app-site-association", which is in the root folder of a web site in azure. Visiting mysite.com/apple-app-site-association should return the JSON text in the browser. I am hosting the site on Azure, and am running a Blazor server project. My project does not have a web.config file.
To be clear, the file "apple-app-site-association" should not have the extension of ".json"
I have looked at this solution and this solution.
I have also tried modifying the Configure() method in Startup.cs to serve static files
app.UseStaticFiles(new StaticFileOptions
{
ServeUnknownFileTypes = true,
DefaultContentType = "application/json"
});
While the above code does correctly serve mysite.com/apple-app-site-association, it has an unwanted side-effect of 404'ing _framework/blazor.server.js.
How can I modify the MIME type of apple-app-site-association so my Blazor server project serves the file up when visiting mysite.com/apple-app-site-association?
Or, using the UseStaticFiles() method above, how can I resolve the 404 error when loading _framework/blazor.server.js?
In _Host.cshtml
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css" />
</head>
<body>
...some stuff...
<script src="_framework/blazor.server.js"></script>
</body>
</html>