Skip to content

Commit 11b94b1

Browse files
Rolando Santamaria MasoRolando Santamaria Maso
authored andcommitted
adding lambda hooks
1 parent 50ac0e4 commit 11b94b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

demos/load-balancer-multiple-proxies.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const gateway = require('../index')
44
const { P2cBalancer } = require('load-balancers')
55
const lambdaProxy = require('http-lambda-proxy')
6+
const { onRequestNoOp, onResponse } = require('./../lib/default-hooks').lambda
67

78
// @TODO: update the list of target origins or proxy instances
89
const targets = [
@@ -21,6 +22,8 @@ gateway({
2122
if (typeof target === 'string') {
2223
proxyOpts.base = target
2324
} else {
25+
proxyOpts.onResponse = onResponse
26+
proxyOpts.onRequest = onRequestNoOp
2427
proxy = target
2528
}
2629

0 commit comments

Comments
 (0)