Open denimamab opened 2 years ago
Can you elaborate about your use cases?
@ljharb Hello,
The use case is to implement a middleware that can read the body for each job and compare the version number with the hypernova-server version number. That assure to re-render the component if the cache version is not valid with the HS version and serve the urls for the right assets (js + css) in the meta field.
Monolithe: construct the jobs to process (if the job is already in a distributed cache [Eg. redis] we set a flag that the job is already in cache and here is the cache version => hypernova-server intercept these jobs and should process only the jobs that are not cache valid.
This answers the problem of cache invalidation strategy when deploying newer version of hypernova-service.
you can access the express app by passing in a onServer
callback to hypernova(config, onServer)
, that way you can add your middlewares after body-parser
https://github.com/airbnb/hypernova/blob/master/src/worker.js#L124
…cess some treatment after the body-parser.)