Will Pages be deprecated soon? It always lacks behind the Workers and is not feature complete as Wor
Will Pages be deprecated soon? It always lacks behind the Workers and is not feature complete as Workers.
We plan to bridge the gaps between Workers and Pages and provide ways to migrate your Pages projects to Workers.I guess it's happening soon


But, I would definitely encourage folks to look at Workers Assets for any new projects.Do (static) Workers Assets count against size Workers size limit (which is 1MB for free accounts vs 25MB for pages, if I get this correctly)
// Main request handler
export default {
async fetch(request, env) {
const url = new URL(request.url);
const secretKey = env.SECRET_KEY; // Defined in the Cloudflare Workers environment
const apiKey = env.API_KEY; // Defined in the Cloudflare Workers environment
// CORS check for allowed domains
//if (!checkCors(url.origin)) {
// return new Response('CORS check failed', { status: 403 });
//}
// Handle /v1/signature path
if (url.pathname === '/v1/signature') {
const nonce = generateNonce();
const signature = await generateHMAC(nonce, apiKey, secretKey);
return new Response(
JSON.stringify({
apiKey,
signature,
nonce,
})
//,
//{
// headers: {
// 'Content-Type': 'application/json',
// 'Access-Control-Allow-Origin': "https://connect-example-react.metalpay.com",
// 'Access-Control-Allow-Methods': 'GET, OPTIONS',
// }
//}
);
}
return env.ASSETS.fetch(request);
},
}Error: Failed to publish your Function. Got error: multipart uploads must contain a readable body_part, main_module, or assets14:46:10.665 Detected the following tools from environment: nodejs@22.11.0, pnpm@9.12.3
14:46:10.665 Installing nodejs 22.11.0
14:46:11.188 Trying to update node-build... ok
14:46:11.225 node-build: definition not found: 22.11.0
14:46:11.233 Error: Exit with error code: 1
14:46:11.233 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
14:46:11.233 at Object.onceWrapper (node:events:652:26)
14:46:11.233 at ChildProcess.emit (node:events:537:28)
14:46:11.233 at ChildProcess._handle.onexit (node:internal/child_process:291:12)