I have developed a simple worker in a file called hello.js
addEventListener(‘fetch’, event => {
event.respondWith(handleRequest(event.request));
});async function handleRequest(request) {
return new Response(Hello World
);
}
Here is my serverless.yml file
service:
name: hello
config:
accountId: $(env.Cloudflare_ACCOUNT_ID)
zoneId: $(env.Cloudflare_ZONE_ID)provider:
name: Cloudflareplugins:
- serverless-Cloudflare-workers
functions:
hello:
name: hello
worker: hello
script: hello
events:
- http:
url: shelterme.com.au/hello/*
method: GET
headers:
foo: bar
When i attempt a deploy i get the following
Serverless: Packaging service…
Serverless: Excluding development dependencies…Type Error ---------------------------------------------
Cannot destructure property
multiscript
of ‘undefined’ or ‘null’.For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: Issues · serverless/serverless · GitHub
Issues: forum.serverless.comYour Environment Information ---------------------------
OS: darwin
Node Version: 8.11.3
Serverless Version: 1.40.0
Any clues?