this repo has no description
1/**
2 * Welcome to Cloudflare Workers! This is your first worker.
3 *
4 * - Run `npm run dev` in your terminal to start a development server
5 * - Open a browser tab at http://localhost:8787/ to see your worker in action
6 * - Run `npm run deploy` to publish your worker
7 *
8 * Bind resources to your worker in `wrangler.jsonc`. After adding bindings, a type definition for the
9 * `Env` object can be regenerated with `npm run cf-typegen`.
10 *
11 * Learn more at https://developers.cloudflare.com/workers/
12 */
13
14export default {
15 async fetch(request, env, ctx): Promise<Response> {
16 const url = new URL(request.url);
17 switch (url.pathname) {
18 case '/message':
19 return new Response('Hello, World!');
20 case '/random':
21 return new Response(crypto.randomUUID());
22 default:
23 return new Response('Not Found', { status: 404 });
24 }
25 },
26} satisfies ExportedHandler<Env>;