0

So, I am trying to deploy my simple stamplay web app but I'm getting an error:

Syntax error in stamplay.json : Unexpected token {

I tried troubleshooting by experimenting with the formatting several ways unsuccessfully. I made sure there was no extra metadata or special characters too.

Although it's probably a stupid mistake I made, I couldn't find how to fix it after more than an hour of searching, any help is appreciated.

 {
     { "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"
                }
              ]
            }
          ]
      }
    }
Daniel E
  • 3
  • 1

2 Answers2

1

Is this what you are trying to do?

{
  "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"
        }
      ]
    }
  ]
}
Fábio Luiz
  • 438
  • 2
  • 11
0

What you have posted isn't valid JSON: it opens as a JSON object but then doesn't follow the { with a string key. You can use, e.g., http://jsonlint.com/ to verify that it's invalid.

nwk
  • 4,004
  • 1
  • 21
  • 22