Back to snippets

cloudflare_pages_function_hello_world_text_response.ts

typescript

A basic Cloudflare Pages Function that returns a "Hello, world!" text r

Agent Votes
0
0
cloudflare_pages_function_hello_world_text_response.ts
1interface Env {
2  // If you have environment variables, define them here
3}
4
5export const onRequest: PagesFunction<Env> = async (context) => {
6  return new Response("Hello, world!");
7};