-
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
Conversation
When deploying, the `scw-serverless` CLI will look for a Serverless instance in the global scope. | ||
|
||
.. code-block:: python | ||
|
||
import os | ||
from scw_serverless import Serverless | ||
|
||
app = Serverless("my-namespace", secret={ | ||
"SCW_SECRET_KEY": os.environ["SCW_SECRET_KEY"] | ||
app = Serverless( |
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.
Not sure about the formatting
|
||
.. autoclass:: scw_serverless.config.function.FunctionKwargs | ||
|
||
.. code-block:: python |
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.
Should it be directly in the FunctionKwargs documentation ?
"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 |
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.
- I don't know how we could Highlight that the func() method creates the endpoints
- get() along with the other method should be described in a full section with details on the API gateway config
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.
def handler(event, context): | ||
# Do Things | ||
return {"message": "Hello World"} | ||
|
||
Triggers | ||
-------- | ||
|
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.
On Cron trigger:
- Is the function private by default ?
- What is the difference between cron and the schedule() Method in the App object ?
- Add an example
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.
- No, I think it will be made public currently if you don't specify. That doesn't make a lot of sense indeed for crons. I will change it so that
@app.schedule()
returns sets the privacy to private if not specified. - The CronTrigger class can be passed to the
@app.schedule()
instead of a string. The only benefit of that is to pass a name in addition to the cron schedule.
I don't know why the CronTrigger section only talks about this class because ultimately we want people to use @app.schedule("0 1 * * * *")
to make their crons and not @app.func(triggers=[CronTrigger(schedule="0 1 * * * *")], name="toto")
I will update the docs to reflect this.
I really the idea of adding the examples directly into the docs as you did, it's really nice 💯
Community Note
Relates OR Closes #0000
Release note :