stan
02/20/2023, 7:22 AMstan
02/20/2023, 7:23 AMPaganMuffin
02/20/2023, 7:24 AMstan
02/20/2023, 7:24 AMstan
02/20/2023, 7:27 AMstan
02/20/2023, 7:27 AMstan
02/20/2023, 7:27 AMstan
02/20/2023, 7:33 AMHardAtWork
02/20/2023, 7:38 AMstan
02/20/2023, 7:42 AMHardAtWork
02/20/2023, 7:49 AMstan
02/20/2023, 7:50 AMstan
02/20/2023, 7:50 AMHardAtWork
02/20/2023, 7:50 AMstan
02/20/2023, 7:51 AMHardAtWork
02/20/2023, 7:52 AMhttps://where.you.want/your/og/image.pngâ–¾
HardAtWork
02/20/2023, 7:53 AMstan
02/20/2023, 7:55 AMstan
02/20/2023, 10:17 AMhttps://731ae19e.blahaj-app.pages.dev/embed/og.pngâ–¾
stan
02/20/2023, 10:18 AMstan
02/20/2023, 10:21 AMDementora_2
02/20/2023, 2:57 PMHello, ${name}
, {status: 200})
> }
>
same code in netlify:
>
> exports.handler = async (event, context) => {
> const name = event.queryStringParameters.name || "World";
>
> return {
> statusCode: 200,
> body: Hello, ${name}
> };
> };
>
is there any online converter for this job ? i want my CFworker code convert to the netlify serverless
my code:
> export default {
> async fetch(req) {
> try {
> const url = new URL(req.url);
> const splitted = url.pathname.replace(/^\/*/, '').split('/');
> const address = splitted[0];
> url.pathname = splitted.slice(1).join('/');
> url.hostname = address;
> url.protocol = 'https';
> return fetch(new Request(url, req));
> } catch (e) {
> return new Response(e);
> }
> }
> };dave
02/20/2023, 3:00 PMDementora_2
02/20/2023, 3:02 PMStigin
02/20/2023, 3:32 PMStigin
02/20/2023, 3:32 PMStigin
02/20/2023, 3:32 PMStigin
02/20/2023, 3:32 PM