@@ -10,11 +10,8 @@ const aws4 = require('../lib/aws4');
1010const log = require ( '../lib/log' ) ;
1111const cloudwatch = require ( '../lib/cloudwatch' ) ;
1212const AWSXRay = require ( 'aws-xray-sdk' ) ;
13-
14- const middy = require ( 'middy' ) ;
13+ const wrapper = require ( '../middleware/wrapper' ) ;
1514const { ssm, secretsManager } = require ( 'middy/middlewares' ) ;
16- const sampleLogging = require ( '../middleware/sample-logging' ) ;
17- const captureCorrelationIds = require ( '../middleware/capture-correlation-ids' ) ;
1815
1916const STAGE = process . env . STAGE ;
2017const awsRegion = process . env . AWS_REGION ;
@@ -99,6 +96,8 @@ const handler = co.wrap(function* (event, context, callback) {
9996
10097 cloudwatch . incrCount ( 'RestaurantsReturned' , restaurants . length ) ;
10198
99+ yield http ( { uri : 'http://google.com' } ) ;
100+
102101 const response = {
103102 statusCode : 200 ,
104103 body : html ,
@@ -110,9 +109,7 @@ const handler = co.wrap(function* (event, context, callback) {
110109 callback ( null , response ) ;
111110} ) ;
112111
113- module . exports . handler = middy ( handler )
114- . use ( captureCorrelationIds ( { sampleDebugLogRate : 0.01 } ) )
115- . use ( sampleLogging ( { sampleRate : 0.01 } ) )
112+ module . exports . handler = wrapper ( handler )
116113 . use ( ssm ( {
117114 cache : true ,
118115 cacheExpiryInMillis : 3 * 60 * 1000 , // 3 mins
0 commit comments