-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* templates: update worker js and ts templates. * remove stackblitz commands from templates. * remove deprecated --local from dev commands. * update compat date and workers types package. * Update templates/worker-typescript/wrangler.toml Co-authored-by: MrBBot <[email protected]> --------- Co-authored-by: MrBBot <[email protected]>
- Loading branch information
Showing
20 changed files
with
100 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
/** | ||
* 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 | ||
* | ||
* Learn more at https://developers.cloudflare.com/workers/ | ||
*/ | ||
|
||
export interface Env { | ||
// Example binding to KV. Learn more at https://developers.cloudflare.com/workers/runtime-apis/kv/ | ||
// MY_KV_NAMESPACE: KVNamespace; | ||
// | ||
// Example binding to Durable Object. Learn more at https://developers.cloudflare.com/workers/runtime-apis/durable-objects/ | ||
// MY_DURABLE_OBJECT: DurableObjectNamespace; | ||
// | ||
// Example binding to R2. Learn more at https://developers.cloudflare.com/workers/runtime-apis/r2/ | ||
// MY_BUCKET: R2Bucket; | ||
// | ||
// Example binding to a Service. Learn more at https://developers.cloudflare.com/workers/runtime-apis/service-bindings/ | ||
// MY_SERVICE: Fetcher; | ||
// | ||
// Example binding to a Queue. Learn more at https://developers.cloudflare.com/queues/javascript-apis/ | ||
// MY_QUEUE: Queue; | ||
} | ||
|
||
export default { | ||
async fetch(request: Request) { | ||
return new Response(`request method: ${request.method}`); | ||
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> { | ||
return new Response('Hello World!'); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
name = "" # todo | ||
main = "./src/index.ts" | ||
compatibility_date = "2022-05-03" | ||
compatibility_date = "2022-10-10" | ||
|
||
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) | ||
# Note: Use secrets to store sensitive data. | ||
# Docs: https://developers.cloudflare.com/workers/platform/environment-variables | ||
# [vars] | ||
# MY_VARIABLE = "production_value" | ||
|
||
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/kv | ||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. | ||
# Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/ | ||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.producers]] | ||
# binding = "MY_QUEUE" | ||
# queue = "my-queue" | ||
|
||
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. | ||
# Docs: https://developers.cloudflare.com/queues/get-started | ||
# [[queues.consumers]] | ||
# queue = "my-queue" | ||
|
||
# Bind another Worker service. Use this binding to call another Worker without network overhead. | ||
# Docs: https://developers.cloudflare.com/workers/platform/services | ||
# [[services]] | ||
# binding = "MY_SERVICE" | ||
# service = "my-service" | ||
|
||
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. | ||
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. | ||
# Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects | ||
# [[durable_objects.bindings]] | ||
# name = "MY_DURABLE_OBJECT" | ||
# class_name = "MyDurableObject" | ||
|
||
# Durable Object migrations. | ||
# Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations | ||
# [[migrations]] | ||
# tag = "v1" | ||
# new_classes = ["MyDurableObject"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name = "" # todo | ||
main = "./index.js" | ||
compatibility_date = "2022-05-03" | ||
main = "./index.js" | ||
compatibility_date = "2022-10-10" |