Skip to content

Commit

Permalink
Add command line option for disabling scheduled events.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-relyea authored and medikoo committed Jan 25, 2022
1 parent 8d61bde commit 4503567
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -115,6 +115,7 @@ All CLI options are optional:
--corsDisallowCredentials When provided, the default Access-Control-Allow-Credentials header value will be passed as 'false'. Default: true
--corsExposedHeaders Used as additional Access-Control-Exposed-Headers header value for responses. Delimit multiple values with commas. Default: 'WWW-Authenticate,Server-Authorization'
--disableCookieValidation Used to disable cookie-validation on hapi.js-server
--disableScheduledEvents Disables all scheduled events. Overrides configurations in serverless.yml.
--dockerHost The host name of Docker. Default: localhost
--dockerHostServicePath Defines service path which is used by SLS running inside Docker container
--dockerNetwork The network that the Docker container will connect to
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -102,6 +102,7 @@
"Gert Jansen van Rensburg (https://github.com/gertjvr)",
"Guillaume Carbonneau (https://github.com/guillaume)",
"György Balássy (https://github.com/balassy)",
"James Relyea (https://github.com/james-relyea)",
"Jarda Snajdr (https://github.com/jsnajdr)",
"Jaryd Carolin (https://github.com/horyd)",
"Jeff Hall (https://github.com/electrikdevelopment)",
Expand Down
2 changes: 1 addition & 1 deletion src/ServerlessOffline.js
Expand Up @@ -94,7 +94,7 @@ export default class ServerlessOffline {
eventModules.push(this._createHttp(httpEvents))
}

if (scheduleEvents.length > 0) {
if (!this.#options.disableScheduledEvents && scheduleEvents.length > 0) {
eventModules.push(this._createSchedule(scheduleEvents))
}

Expand Down
4 changes: 4 additions & 0 deletions src/config/commandOptions.js
Expand Up @@ -28,6 +28,10 @@ export default {
usage: 'Used to disable cookie-validation on hapi.js-server',
type: 'boolean',
},
disableScheduledEvents: {
usage:
'Disables all scheduled events. Overrides configurations in serverless.yml.',
},
enforceSecureCookies: {
usage: 'Enforce secure cookies',
type: 'boolean',
Expand Down
1 change: 1 addition & 0 deletions src/config/defaultOptions.js
Expand Up @@ -8,6 +8,7 @@ export default {
corsAllowOrigin: '*',
corsExposedHeaders: 'WWW-Authenticate,Server-Authorization',
disableCookieValidation: false,
disableScheduledEvents: false,
dockerHost: 'localhost',
dockerHostServicePath: null,
dockerNetwork: null,
Expand Down

0 comments on commit 4503567

Please sign in to comment.