geelen
11/26/2021, 12:07 PMfunctions/index.js
not work?The Freelancer ;)
11/26/2021, 12:10 PMThe Freelancer ;)
11/26/2021, 12:11 PMnpm i
?eidam | SuperSaaS
11/26/2021, 12:20 PMThe Freelancer ;)
11/26/2021, 12:20 PMThe Freelancer ;)
11/26/2021, 12:20 PMnpm i
The Freelancer ;)
11/26/2021, 12:20 PMThe Freelancer ;)
11/26/2021, 12:21 PMThe Freelancer ;)
11/26/2021, 12:21 PMThe Freelancer ;)
11/26/2021, 12:27 PMThe Freelancer ;)
11/26/2021, 12:27 PMThe Freelancer ;)
11/26/2021, 12:28 PMThe Freelancer ;)
11/26/2021, 12:29 PMErisa | Support Engineer
11/26/2021, 12:33 PMThe Freelancer ;)
11/26/2021, 12:33 PMThe Freelancer ;)
11/26/2021, 12:43 PMnpm i
The Freelancer ;)
11/26/2021, 12:43 PMThe Freelancer ;)
11/26/2021, 1:37 PMeidam | SuperSaaS
11/26/2021, 1:42 PMThe Freelancer ;)
11/26/2021, 1:43 PMThe Freelancer ;)
11/26/2021, 1:50 PMThe Freelancer ;)
11/26/2021, 1:57 PMThe Freelancer ;)
11/26/2021, 2:00 PMThe Freelancer ;)
11/26/2021, 2:00 PMMarcelino Franchini
11/26/2021, 8:59 PMThe Freelancer ;)
11/26/2021, 8:59 PMThe Freelancer ;)
11/26/2021, 8:59 PMThe Freelancer ;)
11/26/2021, 9:00 PMjavascript
export async function onRequest(context) {
// Contents of context object
const { request, env, params, waitUntil, next, data, } = context;
const url = new URL(request.url);
const destinationURL = "https://" + env.REDIRECT_URL;
const statusCode = 302;
if (url.hostname.endsWith(".pages.dev")) {
return Response.redirect(destinationURL, statusCode);
}
return next()
}
The Freelancer ;)
11/26/2021, 9:00 PMzve8
11/26/2021, 11:38 PM./functions
file structure bundler? I see I could do a custom advanced usage bundle (_workers.js
) but then there would be a function invocation for every asset call.