No but I can post code, it's only a few lines a this point.
No but I can post code, it's only a few lines a this point.
default it appears to work.wrangler detects the type of the Worker based on whether or not you export default. If it isn't export default, then it assumes you are using Service Worker syntaxclass have a fetch() method?wrangler.toml include a route/workers.dev?workers_dev = falseworkers_dev by default, unless you add a routefetch() method, even if it doesn't actually do anythingasync fetch(){} to class and it deployed.fetch even if you have export default {}dotenv to be a string of .env.env file.dev.vars[vars] and you upload secrets with wrangler secret putdefaultexport default class Mailer extends WorkerEntrypoint {...export class Mailer extends WorkerEntrypoint {...export defaultexport defaultThe uploaded script has no registered event handlers. [code: 10068]classname = "worker-t"
main = "src/worker.js"
compatibility_date = "2024-05-07"
node_compat = trueworkers_dev = falseworkers_devasync fetch(){}export default {}[vars]wrangler secret putexport interface Env {
BUCKET_URL_AUTH_GENERATION_KEY: string;
BUCKET_URL_SYMMETRIC_KEY: string;
}
export default {
async fetch(request: Request, env: Env,): Promise<Response> {
if (!env.BUCKET_URL_AUTH_GENERATION_KEY || !env.BUCKET_URL_SYMMETRIC_KEY) {
return new Response("Missing required environment variables", { status: 500 });
}export default {
fetch(req: Request) {
const someHeader = req.headers.get("some-header");
}
}