Migrating from Vercel, vercel.json alternative

Hello everyone,

I am migrating my projects from Vercel but cant find a way to setup my project like I used to in vercel using a vercel.json that contains:


{
  "headers": [
    {
      "source": "/assets/babylon/ext.babylon",
      "headers": [
        {
          "key": "Accept-Encoding",
          "value": "br"
        },
        {
          "key": "content-encoding",
          "value": "br"
        }
      ]
    }
  ],

  "cleanUrls": true
}

I have some “.babylon” files pre-compressed in brotli and just need the browser to use them.

Any idea in how to achieve this?

You can set headers in Pages with a _headers file, docs: Headers · Cloudflare Pages docs

Thank you for the quick answer but it isnt working, I have tried the following:

/assets/babylon/*.babylon
  Content-Encoding: br

/assets/babylon/ext.babylon
  Content-Encoding: br

My bad, I was trying to use _header.txt, but it need to be just _header, without any extension.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.