fix worker + start create modal with logic
This commit is contained in:
@ -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') {
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user