Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fschaeffler/middy-maintenance-mode
Middy Plugin for Maintenance Mode
https://github.com/fschaeffler/middy-maintenance-mode
Last synced: 10 days ago
JSON representation
Middy Plugin for Maintenance Mode
- Host: GitHub
- URL: https://github.com/fschaeffler/middy-maintenance-mode
- Owner: fschaeffler
- Created: 2020-01-12T00:04:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-12T01:04:56.000Z (almost 5 years ago)
- Last Synced: 2024-12-23T20:24:24.485Z (14 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Middy Maintance Mode
## Usage
```
const maintenanceMode = require('middy-maintenance-mode')
middy(handler).use(maintenanceMode({
envVariable: 'MAINTENANCE_MODE',
envVariableValue: 'on',
isEnabled: () => {
const isActive = true
return isActive
},
message: 'service in maintainance mode'
}))
```## Options
```
envVariable: DEFAULT_VARIABLE, // env variable to check for
envVariableValue: DEFAULT_VARIABLE_VALUE, // value to check for maintainance mode
stageVariable: DEFAULT_VARIABLE,
stageVariableValue: DEFAULT_VARIABLE_VALUE,
isEnabled: undefined,
statusCode: 503, // service unavailable
headers: {
'Retry-After': 60 * 15 // 15 minutes
},
message: undefined
```