Closed ii-igku closed 3 years ago
Hi @ii-igku ,
Plugins are executed in order.
What you probably want is to first transpile your middleware, then add the warmup function (so it's not transpiled) and then start the offline server (so it includes the transpiled functions and the warmup function).
So:
plugins:
- serverless-middleware
- serverless-plugin-warmup
- serverless-offline
hi @juanjoDiaz , thanks a lot, changing the order of plugins helped
After I put serverless-middleware
before serverless-plugin-warmup
and deployed to aws the warmup function was not embedded in the middleware wrapper anymore.
thanks for the help!
Hi, I've spotted that the serverless-plugin-warmup plugin stopped working after I've installed serverless-middleware and configured a global 'pre' function. the idea was to extract the warmup check into a global middleware 'pre' function like this:
then I configured serverless.yml like this:
after deploy I have the warmup lambda function created, but it looks like the warmup function was wrapped up by the middleware plugin and in the lambda runtime settings I have
HandlerInfo
set to.middleware/influencer-index-api-staging-warmup-plugin-officeHours.handler
whereas normally it would be set to.warmup/officeHours/index.warmUp
therefore I now have the next error in the warmup lambda logs:
is there anything I can do to make it work?
p.s. sorry for duplicating this issue here, just wasn't sure where this should be reported...