I want to move the following code that works in Cloudflare Worker to another server like Vercel
worker.js
addEventListener(
"fetch", event => {
let url = new URL(event.request.url);
url.hostname = "popdev.me";
url.protocol = "https";
let request = new Request(url, event.request);
event.respondWith(
fetch(request)
);
}
);
*I tested it in the repository below as I thought it was correct, but it didn’t work
*https://github.com/fx505/nodejs-serverless-function-express
Please guide me what changes to make and how to set it up
New contributor
Yasin Dev81 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.