I have created a pages function with following code in a file called index.js and put it directly un

I have created a pages function with following code in a file called index.js and put it directly under the functions folder -

export async function onRequestGet(context) {
    console.log('Inside index.html proxy function ..')
    return context.next()
}

The idea behind this function is to execute it before serving index.html file ONLY and to avoid it for other static assets from pages application. This is something which I could not achieve with worker or functions middleware. While this works in local setup, this is not getting executed when deployed on cloudflare. So my question is which behavior (local or cloudflare) is correct?
Was this page helpful?