WEB3WEBSITES
Subtitle: W3W
By: INT
Edition: ETHEREUM
Series: $HASH$
Publisher: Karam Jameel Moore
Published: 2021
Place of publication: GRAPHQL
Translation of: WALLY WORLD BY WAWMART
Format: LEGAL DOCUSIGNS
Number of pages: 1001
Copyright date: 2011
Other titles: WWIII
First sentence: KingKaram.Com
Description: name = "<YOUR_WORKER_NAME>"
main = "src/index.js"
compatibility_date = "2022-06-30"

account_id = "YOUR_ACCOUNT_ID" # ← Replace with your Account ID.
workers_dev = true
Notes: [[r2_buckets]]
binding = 'MY_BUCKET' # <~ valid JavaScript variable name
bucket_name = '<YOUR_BUCKET_NAME>'
Table of contents: title: export default {; title: async fetch(request, env) {; title: const url = new URL(request.url);; title: const key = url.pathname.slice(1);; title: switch (request.method) {; title: case 'PUT':; title: await env.MY_BUCKET.put(key, request.body);; title: return new Response(`Put ${key} successfully!`);; title: case 'GET':; title: const object = await env.MY_BUCKET.get(key);; title: if (object === null) {; title: return new Response('Object Not Found', { status: 404 });; title: }; title: const headers = new Headers();; title: object.writeHttpMetadata(headers);; title: headers.set('etag', object.httpEtag);; title: return new Response(object.body, {; title: headers,; title: });; title: case 'DELETE':; title: await env.MY_BUCKET.delete(key);; title: return new Response('Deleted!');; title: default:; title: return new Response('Method Not Allowed', {; title: status: 405,; title: headers: {; title: Allow: 'PUT, GET, DELETE',; title: },; title: });; title: }; title: },; title: };