commit 6bab4ec241bc0a8e269d9049cce1c9845fce9495 Author: multipleof4 Date: Thu Sep 11 13:50:04 2025 -0700 Initial commit diff --git a/.github/workflows/auto-name.yml b/.github/workflows/auto-name.yml new file mode 100644 index 0000000..50afac1 --- /dev/null +++ b/.github/workflows/auto-name.yml @@ -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 + } diff --git a/.github/workflows/deep.yml b/.github/workflows/deep.yml new file mode 100644 index 0000000..2c3051d --- /dev/null +++ b/.github/workflows/deep.yml @@ -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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4138168 --- /dev/null +++ b/.gitignore @@ -0,0 +1,167 @@ +# Logs + +logs +_.log +npm-debug.log_ +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) + +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json + +# Runtime data + +pids +_.pid +_.seed +\*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover + +lib-cov + +# Coverage directory used by tools like istanbul + +coverage +\*.lcov + +# nyc test coverage + +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) + +.grunt + +# Bower dependency directory (https://bower.io/) + +bower_components + +# node-waf configuration + +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) + +build/Release + +# Dependency directories + +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) + +web_modules/ + +# TypeScript cache + +\*.tsbuildinfo + +# Optional npm cache directory + +.npm + +# Optional eslint cache + +.eslintcache + +# Optional stylelint cache + +.stylelintcache + +# Microbundle cache + +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history + +.node_repl_history + +# Output of 'npm pack' + +\*.tgz + +# Yarn Integrity file + +.yarn-integrity + +# parcel-bundler cache (https://parceljs.org/) + +.cache +.parcel-cache + +# Next.js build output + +.next +out + +# Nuxt.js build / generate output + +.nuxt +dist + +# Gatsby files + +.cache/ + +# Comment in the public line in if your project uses Gatsby and not Next.js + +# https://nextjs.org/blog/next-9-1#public-directory-support + +# public + +# vuepress build output + +.vuepress/dist + +# vuepress v2.x temp and cache directory + +.temp +.cache + +# Docusaurus cache and generated files + +.docusaurus + +# Serverless directories + +.serverless/ + +# FuseBox cache + +.fusebox/ + +# DynamoDB Local files + +.dynamodb/ + +# TernJS port file + +.tern-port + +# Stores VSCode versions used for testing VSCode extensions + +.vscode-test + +# yarn v2 + +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.\* + +# wrangler project + +.dev.vars* +!.dev.vars.example +.env* +!.env.example +.wrangler/ diff --git a/index.js b/index.js new file mode 100644 index 0000000..a682017 --- /dev/null +++ b/index.js @@ -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 } diff --git a/package.json b/package.json new file mode 100644 index 0000000..97f6c67 --- /dev/null +++ b/package.json @@ -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.*" + } +} diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..2feca89 --- /dev/null +++ b/wrangler.toml @@ -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"]