-
Notifications
You must be signed in to change notification settings - Fork 3
Add Info on the config page #46
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,16 @@ When deploying, the `scw-serverless` CLI will look for a Serverless instance in | |
secret={ | ||
"SCW_SECRET_KEY": os.environ["SCW_SECRET_KEY"], | ||
"MY_SECRET_KEY": os.environ["MY_SECRET_KEY"] | ||
}, | ||
gateway_domains=["app.example.com"] | ||
}, | ||
}) | ||
|
||
.. autoclass:: scw_serverless.app.Serverless | ||
:members: func, schedule, get | ||
:members: func | ||
|
||
Functions | ||
--------- | ||
|
||
To configure your serverless functions, you can provide keyword arguments to the decorators. The Function name that will appear in Scaleway console will be the name of your the function's handler. | ||
To configure your serverless functions, you can provide keyword arguments to the decorators. The Function name that will appear in Scaleway console will be the name of your function's handler. | ||
|
||
.. autoclass:: scw_serverless.config.function.FunctionKwargs | ||
|
||
|
@@ -46,19 +45,28 @@ To configure your serverless functions, you can provide keyword arguments to the | |
memory_limit= 256, | ||
timeout= 300, | ||
description= "Lores Ipsum", | ||
http_option= "enabled" #https only | ||
http_option= "enabled", # https only | ||
) | ||
def handler(event, context): | ||
# Do Things | ||
return {"message": "Hello World"} | ||
return {"body": "Hello World"} | ||
|
||
Triggers | ||
-------- | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Cron trigger:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't know why the CronTrigger section only talks about this class because ultimately we want people to use I really the idea of adding the examples directly into the docs as you did, it's really nice 💯 |
||
By default, Scaleway Functions are given an http endpoint that can be called to execute your function. | ||
In addition, you can set up additionnal triggers that will run your function on specific occasions. | ||
By default, Scaleway Functions are given an HTTP endpoint that can be called to execute your function. | ||
In addition, you can set up additional triggers that will run your function on specific occasions. | ||
|
||
Cron triggers | ||
^^^^^^^^^^^^^ | ||
|
||
.. autoclass:: scw_serverless.triggers.cron.CronTrigger | ||
To create a function that will run periodically, you can use the `schedule` decorator. | ||
If do not want your function to be publicly available, set the privacy to `private`. | ||
|
||
.. code-block:: python | ||
|
||
app.schedule("0 8 * * *", privacy="private") | ||
def handler(event, context): | ||
... | ||
|
||
.. autofunction:: scw_serverless.app.Serverless.schedule |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
API Gateway | ||
=========== | ||
|
||
.. warning:: Not yet implemented. | ||
|
||
Routed functions | ||
^^^^^^^^^^^^^^^^ | ||
|
||
.. autodocs:: scw_serverless.app.Serverless.func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a really brilliant idea, it makes sense to group everything API-gateway related into a single big config chapter. Thanks a lot for the suggestion.