Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```