anymaniax
anymaniax
CDCloudflare Developers
Created by anymaniax on 7/10/2024 in #workers-help
Worker replaced by Cloudflare snippets
I currently have a worker that we use to route our traffic to old and new applications depending on the path. I made a Cloudflare snippet that does the same and it's quite easy to manage. Snippets are made for that?
3 replies
CDCloudflare Developers
Created by anymaniax on 4/15/2024 in #general-help
cloudflared with mysql deno
I followed this example https://github.com/brettscott/cloudflare-worker-tunnel-mysql-example and got it working. I have a question (maybe stupid 😅 ). Is possible that the service cloudflared get overloaded with 50k users daily?
3 replies
CDCloudflare Developers
Created by anymaniax on 7/19/2023 in #pages-help
Middleware forward headers to other functions
Hello, I am building a next application and I have a middleware where I add the href in a header. Then I access it in some server components. It's working correctly on Vercel and locally but on Cloudflare, the header is not forwarded to the server components. Do I need to add something else? Or do you have another solution? I want to access some query params in a nextjs layout but from what I know it's not directly possible right now. Thanks. Example:
export function middleware(request: NextRequest) {
const response = NextResponse.next();

response.headers.append('x-href', request.nextUrl.href);


return response;
}
export function middleware(request: NextRequest) {
const response = NextResponse.next();

response.headers.append('x-href', request.nextUrl.href);


return response;
}
13 replies