Closed patel-jeel92 closed 2 years ago
You can't, response is not serializable. You should generate the HTML content on the API gateway side in onAfterCall
hook.
Is there a way to only call onAfterCall
for a specific endpoint. I dont want the html generated on each call.
you have access to ctx
, so you can check when you need. E.g. set a templateName in the action handler like ctx.meta.templateName = "index"
. And check this property in the onAfterCall
as well. Otherwise just return the data
without templating.
I have a Express js service that uses pugjs to render some files and send HTML as response. The way to do this is by using
res.render(...)
method in the service. I call this service from my API Gateway. In my Service A action, how can i access the response object so I can send html file back to the caller?