New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5619 - Update Cloudflare Templates #5620

Merged
merged 2 commits into from Dec 20, 2018
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+1,654 −1,654
Diff settings

Always

Just for now

@@ -29,8 +29,8 @@ serverless invoke --function helloWorld
... ...
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
events: events:
@@ -21,8 +21,8 @@ When creating a service your serverless yml will define which endpoint is used f
... ...
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
events: events:
@@ -32,8 +32,8 @@ And its corresponding Serverless yml file:
... ...
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
events: events:
@@ -70,8 +70,8 @@ plugins:
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# Events are optional to declare and only affect the `serverless invoke` command # Events are optional to declare and only affect the `serverless invoke` command
@@ -85,7 +85,7 @@ functions:
# Only Enterprise accounts would be allowed to add this second function # Only Enterprise accounts would be allowed to add this second function
foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -12,7 +12,7 @@ layout: Doc




# Cloudflare Workers - Events # Cloudflare Workers - Events
Simply put, events are the things that trigger your functions to run. C Simply put, events are the things that trigger your functions to run.


If you are using Cloudflare Workers as your provider, all `events` in the service are HTTP Events, because that is the only event that Cloudflare Workers currently support. If you are using Cloudflare Workers as your provider, all `events` in the service are HTTP Events, because that is the only event that Cloudflare Workers currently support.


@@ -22,8 +22,8 @@ If you are using Cloudflare Workers as your provider, all `events` in the servic
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# If you would like to develop using multiple scripts or libraries, you can automatically bundle with a simple predefined configuration. # If you would like to develop using multiple scripts or libraries, you can automatically bundle with a simple predefined configuration.
@@ -57,6 +57,6 @@ async function handleRequest(request) {
} }
``` ```


If your handler script looks like the above, thbe includeMe script will be packed into the final script on deployment. If your handler script looks like the above, the includeMe script will be packed into the final script on deployment.


[View the Cloudflare Workers events section for more information on HTTP events](../events). [View the Cloudflare Workers events section for more information on HTTP events](../events).
@@ -35,8 +35,8 @@ plugins:
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way # Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way
@@ -81,8 +81,8 @@ plugins:
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way # Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way
@@ -96,7 +96,7 @@ functions:
# Only Enterprise accounts would be allowed to add this second function and its corresponding route above # Only Enterprise accounts would be allowed to add this second function and its corresponding route above
foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -51,8 +51,8 @@ plugins:
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way # Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way
@@ -67,7 +67,7 @@ functions:
# Only Enterprise accounts would be allowed to add this second function and its corresponding route above # Only Enterprise accounts would be allowed to add this second function and its corresponding route above
foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -86,7 +86,7 @@ Your Function must have the `events` field populated in order for the `serverles
# serverless.yml # serverless.yml
... ...
foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -91,8 +91,8 @@ plugins:
functions: functions:
helloWorld: helloWorld:
# What the script will be called on Cloudflare # What the script will be called on Cloudflare (this property value must match the function name one line above)
name: hello name: helloWorld
# The name of the script on your machine, omitting the .js file extension # The name of the script on your machine, omitting the .js file extension
script: helloWorld script: helloWorld
# Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way # Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way
@@ -106,7 +106,7 @@ functions:
# Only Enterprise accounts would be allowed to add this second function and its corresponding route above # Only Enterprise accounts would be allowed to add this second function and its corresponding route above
foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -9,6 +9,6 @@
"author": "cloudflare", "author": "cloudflare",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"serverless-cloudflare-workers": "0.1.1" "serverless-cloudflare-workers": "1.0.5"
} }
} }
@@ -11,7 +11,7 @@ plugins:
- serverless-cloudflare-workers - serverless-cloudflare-workers


functions: functions:
helloWorld: hello:
name: hello name: hello
script: helloWorld script: helloWorld
events: events:
@@ -23,7 +23,7 @@ functions:
x-client-data: value x-client-data: value


foo: foo:
name: foo_script name: foo
script: bar script: bar
events: events:
- http: - http:
@@ -9,6 +9,6 @@
"author": "cloudflare", "author": "cloudflare",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"serverless-cloudflare-workers": "0.1.1" "serverless-cloudflare-workers": "1.0.5"

This comment has been minimized.

@jspies

jspies Dec 20, 2018

Contributor

nice thanks!

} }
} }
@@ -11,7 +11,7 @@ plugins:
- serverless-cloudflare-workers - serverless-cloudflare-workers


functions: functions:
helloWorld: hello:
name: hello name: hello
script: helloWorld # there must be a file called helloWorld.js script: helloWorld # there must be a file called helloWorld.js
events: events:
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.