Initial commit

This commit is contained in:
2025-12-03 14:19:09 -08:00
committed by GitHub
commit 53db430826
6 changed files with 120 additions and 0 deletions

17
.github/workflows/auto-name.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
on: push
permissions: write-all
jobs:
j:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
n=${GITHUB_REPOSITORY#*/};n=$(echo $n|tr A-Z a-z)
jq ".name=\"$n\"" package.json>p.json && mv p.json package.json
sed -i "s/^name *=.*$/name = \"$n\"/" wrangler.toml
git diff --quiet || {
git config user.email a@a.a
git config user.name a
git commit -am update
git push
}

11
.github/workflows/deep.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
on:
workflow_dispatch:
push:
jobs:
deploy-cloudflare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}

22
.gitignore vendored Normal file
View File

@@ -0,0 +1,22 @@
logs
*.log
npm-debug.log
.pnpm-debug.log
node_modules/
jspm_packages/
.npm
.eslintcache
.stylelintcache
.node_repl_history
*.tgz
.cache
out
dist
.temp
.cache
.pnp.*
.dev.vars
!.dev.vars.example
.env
!.env.example
.wrangler/

11
index.js Normal file
View File

@@ -0,0 +1,11 @@
async function fetch(request) {
if (request.method === 'OPTIONS') {
const headers = new Headers()
headers.set('Access-Control-Allow-Origin', '*')
headers.set('Access-Control-Allow-Headers', 'Authorization, Content-Type')
return new Response(null, { headers })
}
return new Response('OK')
}
export default { fetch }

15
package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "workertemplate",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev",
"start": "wrangler dev"
},
"dependencies": {},
"devDependencies": {
"wrangler": "4.33.*"
}
}

44
wrangler.toml Normal file
View File

@@ -0,0 +1,44 @@
name = "workertemplate"
main = "index.js"
compatibility_date = "2025-09-09"
# compatibility_flags = []
# node_compat = true
# keep_vars = true
# [triggers]
# crons = ["*/5 * * * *"]
# [vars]
# [assets]
# directory = "./public"
# binding = "ASSETS"
# [wasm_modules]
# WASM_PARSER = "./wasm/parser.wasm"
# [text_blobs]
# EMAIL_TEMPLATE = "./templates/welcome.txt"
# [data_blobs]
# BINARY_CHUNK = "./assets/blob.bin"
# [[kv_namespaces]]
# binding = "MY_KV"
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# [[r2_buckets]]
# binding = "MY_BUCKET"
# bucket_name = "my-bucket"
# [[d1_databases]]
# binding = "DB"
# database_name = "my-db"
# database_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# [durable_objects]
# bindings = [{ name = "MY_DO", class_name = "MyDurableObject" }]
# [[migrations]]
# tag = "v1"
# new_classes = ["MyDurableObject"]