···11+/**
22+ * Welcome to Cloudflare Workers! This is your first worker.
33+ *
44+ * - Run `npm run dev` in your terminal to start a development server
55+ * - Open a browser tab at http://localhost:8787/ to see your worker in action
66+ * - Run `npm run deploy` to publish your worker
77+ *
88+ * Bind resources to your worker in `wrangler.jsonc`. After adding bindings, a type definition for the
99+ * `Env` object can be regenerated with `npm run cf-typegen`.
1010+ *
1111+ * Learn more at https://developers.cloudflare.com/workers/
1212+ */
1313+1414+export default {
1515+ async fetch(request, env, ctx): Promise<Response> {
1616+ const url = new URL(request.url);
1717+ switch (url.pathname) {
1818+ case '/message':
1919+ return new Response('Hello, World!');
2020+ case '/random':
2121+ return new Response(crypto.randomUUID());
2222+ default:
2323+ return new Response('Not Found', { status: 404 });
2424+ }
2525+ },
2626+} satisfies ExportedHandler<Env>;
···11+{
22+ "compilerOptions": {
33+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
44+55+ /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
66+ "target": "es2021",
77+ /* Specify a set of bundled library declaration files that describe the target runtime environment. */
88+ "lib": ["es2021"],
99+ /* Specify what JSX code is generated. */
1010+ "jsx": "react-jsx",
1111+1212+ /* Specify what module code is generated. */
1313+ "module": "es2022",
1414+ /* Specify how TypeScript looks up a file from a given module specifier. */
1515+ "moduleResolution": "Bundler",
1616+ /* Enable importing .json files */
1717+ "resolveJsonModule": true,
1818+1919+ /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
2020+ "allowJs": true,
2121+ /* Enable error reporting in type-checked JavaScript files. */
2222+ "checkJs": false,
2323+2424+ /* Disable emitting files from a compilation. */
2525+ "noEmit": true,
2626+2727+ /* Ensure that each file can be safely transpiled without relying on other imports. */
2828+ "isolatedModules": true,
2929+ /* Allow 'import x from y' when a module doesn't have a default export. */
3030+ "allowSyntheticDefaultImports": true,
3131+ /* Ensure that casing is correct in imports. */
3232+ "forceConsistentCasingInFileNames": true,
3333+3434+ /* Enable all strict type-checking options. */
3535+ "strict": true,
3636+3737+ /* Skip type checking all .d.ts files. */
3838+ "skipLibCheck": true,
3939+ "types": [
4040+ "node",
4141+ "worker-configuration.d.ts"
4242+ ]
4343+ },
4444+ "exclude": ["test"],
4545+ "include": ["worker-configuration.d.ts", "src/**/*.ts"]
4646+}