@middy/warmup
Advanced tools
Comparing version 5.0.0-alpha.1 to 5.0.0-alpha.2
34
index.js
const defaults = { | ||
isWarmingUp: (event) => event.source === 'serverless-plugin-warmup' | ||
} | ||
isWarmingUp: (event)=>event.source === 'serverless-plugin-warmup' | ||
}; | ||
const warmupMiddleware = (opt)=>{ | ||
const options = { | ||
...defaults, | ||
...opt | ||
}; | ||
const warmupMiddlewareBefore = (request)=>{ | ||
if (options.isWarmingUp(request.event)) { | ||
return 'warmup'; | ||
} | ||
}; | ||
return { | ||
before: warmupMiddlewareBefore | ||
}; | ||
}; | ||
export default warmupMiddleware; | ||
const warmupMiddleware = (opt) => { | ||
const options = { ...defaults, ...opt } | ||
const warmupMiddlewareBefore = (request) => { | ||
if (options.isWarmingUp(request.event)) { | ||
return 'warmup' | ||
} | ||
} | ||
return { | ||
before: warmupMiddlewareBefore | ||
} | ||
} | ||
export default warmupMiddleware |
{ | ||
"name": "@middy/warmup", | ||
"version": "5.0.0-alpha.1", | ||
"version": "5.0.0-alpha.2", | ||
"description": "Warmup (cold start mitigation) middleware for the middy framework", | ||
@@ -63,5 +63,5 @@ "type": "module", | ||
"devDependencies": { | ||
"@middy/core": "5.0.0-alpha.1" | ||
"@middy/core": "5.0.0-alpha.2" | ||
}, | ||
"gitHead": "ebce8d5df8783077fa49ba62ee9be20e8486a7f1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6117
25