【问题标题】:Serving json file at a particular url for Android deep linking在特定 url 为 Android 深度链接提供 json 文件
【发布时间】:2017-05-08 18:58:33
【问题描述】:

我正在尝试为 Android 深度链接提供一个 json 文件。我在我的 Web 表单项目的根目录中创建了一个 .well-known 文件夹,其中包含一个 assetlinks.json 文件。当我将文件发布到 Azure 应用服务并导航到 /.well-known/assetlinks.json 路径时,我收到 404 错误。

我还需要做些什么来提供静态文件吗?

【问题讨论】:

    标签: android json azure webforms deep-linking


    【解决方案1】:

    Azure 应用服务默认不支持.json 文件的静态内容。解决方案是将以下内容添加到路径wwwroot 下的web.config 文件中。如果没有web.config 文件,只需创建它即可。

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.webServer>
        <staticContent>
          <mimeMap fileExtension=".json" mimeType="application/json" />
        </staticContent>
      </system.webServer>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 2012-07-19
      • 1970-01-01
      • 2017-02-08
      • 2017-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多