Skip to content

Commit 77657b9

Browse files
committed
Update readme
1 parent e575624 commit 77657b9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@ module.exports.lambdaToWarm = function(event, context, callback) {
202202
... add lambda logic after
203203
}
204204
```
205+
You can also check for the warmp event using the `context` variable. This could be useful if you are handling the raw input and output streams:
206+
207+
```javascript
208+
...
209+
210+
if(context.custom.source === 'serverless-plugin-warmup'){
211+
console.log('WarmUP - Lambda is warm!')
212+
return callback(null, 'Lambda is warm!')
213+
}
214+
215+
...
216+
```
217+
218+
205219

206220
* All done! WarmUP will run on SLS `deploy` and `package` commands
207221

0 commit comments

Comments
 (0)