I have this code:
const someVar = "some value";
const rewriteFunction = new cf.experimental.EdgeFunction(
this,
"RewriteFunction",
{
runtime: Runtime.NODEJS_18_X,
handler: "index.handler",
code: Code.fromInline(`
exports.handler = async (event) => {
const request = event.Records[0].cf.request;
//I want to access someVar here
};
`),
}
);
How can I access someVar
inside the dynamic code passed to fromInline()
?
1