-
Notifications
You must be signed in to change notification settings - Fork 10k
Closed
Labels
content:editRequest for content editsRequest for content editsdocumentationDocumentation editsDocumentation editsproduct:containers
Description
Existing documentation URL(s)
In section Using envVars on the Container class we have the following code snippet:
export class MyContainer extends Container {
defaultPort = 8080;
sleepAfter = '10s';
envVars = {
ACCOUNT_NAME: env.ACCOUNT_NAME,
ACCOUNT_API_KEY: env.SECRET_STORE.ACCOUNT_API_KEY,
CONTAINER_SECRET_KEY: env.CONTAINER_SECRET_KEY,
};
}Here env variable is used even though it kinda supposed to be passed only to fetch handler of a worker and the definition of MyContainer class is module-level in all examples.
What changes are you suggesting?
In my opinion documentation need either:
- Clarify from where this
envvariable is imported - if this env variable is not related to env variable in fetch handler of a worker - then it would be better to change it's name in this example or clarify that it's a different variable to avoid confusion
- Write an example alternative approach if this usage of env variable in class, that should be defined outside of fetch handler, was demonstrated by mistake
Additional information
No response
yuvadm
Metadata
Metadata
Assignees
Labels
content:editRequest for content editsRequest for content editsdocumentationDocumentation editsDocumentation editsproduct:containers