Porting a proxy from Cloudflare worker to AWS lambda

Hey there,
Having a bit of an issue with porting over some code between Cloudflare and the serverless framework.

Basically, changing the URL out during the request to query a different endpoint (on the same domain).

Cloudflare worker proof of concept:

I’m just not sure what I should be doing to modify the underlying request with Serverless to do the same thing.

Any help would be great.

Thanks