fix worker + start create modal with logic

This commit is contained in:
Ishaan Dey
2024-04-23 01:53:37 -04:00
parent 54617877f9
commit ffee1b60c7
26 changed files with 979 additions and 5426 deletions

View File

@ -1,18 +1,22 @@
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run `npm run dev` in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run `npm run deploy` to publish your worker
*
* Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the
* `Env` object can be regenerated with `npm run cf-typegen`.
*
* Learn more at https://developers.cloudflare.com/workers/
*/
const success = new Response('Success', { status: 200 });
const notFound = new Response('Not Found', { status: 404 });
const methodNotAllowed = new Response('Method Not Allowed', { status: 405 });
export interface Env {
DB: D1Database;
R2: R2Bucket;
}
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
return new Response('Hello World!');
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext // : Promise<Response>
) {
const url = new URL(request.url);
const path = url.pathname;
const method = request.method;
if (method === 'GET') {
}
},
};