0

因此,我正在尝试部署我的简单stamplay web 应用程序,但出现错误:

stamplay.json 中的语法错误:意外的令牌 {

我尝试通过尝试几种格式化方式来进行故障排除,但均未成功。我确保没有额外的元数据或特殊字符。

虽然这可能是我犯的一个愚蠢的错误,但经过一个多小时的搜索,我找不到如何解决它,感谢任何帮助。

 {
     { "appId": "name",
      "apiKey": "apikeyhere",
      "public": "./",
      "ignore": [
        "stamplay.json",
        "**/.*",
        "**/node_modules/**"
      ] }
     { "headers": [
          {
            "source" : "**/*.@(jpg|gif|png|mp3|mp4)",
            "headers" : [
              {
                "key" : "Cache-Control",
                "value" : "max-age=7200"
              }
            ]
          },
            {
              "source" : "**/*.@(html|css|js|php)",
              "headers" : [
                {
                  "key" : "expires",
                  "value" : "1y"
                }
              ]
            }
          ]
      }
    }
4

2 回答 2

1

这是你想要做的吗?

{
  "appId": "name",
  "apiKey": "apikeyhere",
  "public": "./",
  "ignore": [
    "stamplay.json",
    "**/.*",
    "**/node_modules/**"
  ],
  "headers": [
    {
      "source": "**/*.@(html|css|js|php)",
      "headers": [
        {
          "key": "expires",
          "value": "1y"
        }
      ]
    },
    {
      "source": "**/*.@(html|css|js|php)",
      "headers": [
        {
          "key": "expires",
          "value": "1y"
        }
      ]
    }
  ]
}
于 2016-06-02T20:52:00.013 回答
0

您发布的内容不是有效的 JSON:它作为 JSON 对象打开,但随后没有{使用字符串键。您可以使用例如http://jsonlint.com/来验证它是否无效。

于 2016-06-02T20:37:31.177 回答