Closed yvz5 closed 4 years ago
Hi the template you should be using is node12, can you switch please?
I don't believe that this template supported the raw body anyway.
Alex
Which one is it ? its not under this organization
I would encourage all users to make use of the documentation that we've provided and Google.
https://docs.openfaas.com/cli/templates/#nodejs-12-node12-of-watchdog-template
node12 is an official template and also in the template store. Please read the documentation.
Ofcourse I did read the documentation but the information is all over the place. Its really hard to follow.
I am using of-watchdog, in incubator you have templates listed which are using of-watchdog, there you have only node10. You have another organization which is really confusing, that contains the old watchdog templates. There you have node12 template. I compared both code and the only difference is node12 std watchdog version uses Promises to handle the function code. The rest is the same.
This problem happens when using both of the templates with of-watchdog. I've added ENV buffer_http="true"
to the dockerfile without any luck.
I solved my problem by bypassing the bodyparser. If anyone has the same problem, you can find more info here: https://stackoverflow.com/questions/18710225/node-js-get-raw-request-body-using-express/21222540#21222540
Of course I did read the documentation but the information is all over the place. Its really hard to follow.
I'm sorry I have no idea what you are talking about there. Can you elaborate?
The information is only in one place, in the docs which you can access from openfaas.com - the page below says to use the node12 template and that node10 is deprecated by nodejs.org
.
https://docs.openfaas.com/cli/templates/#nodejs-12-node12-of-watchdog-template
I solved my problem by bypassing the bodyparser. If anyone has the same problem, you can find more info here: https://stackoverflow.com/questions/18710225/node-js-get-raw-request-body-using-express/21222540#21222540
We have already solved this problem, if you read the documentation more carefully you will see a RAW_BODY
parameter which is only available on the node12 template. The effect of it? To bypass the body parser.
See below:
https://docs.openfaas.com/cli/templates/#nodejs-12-node12-access-to-the-raw-body
I am using kafka-connector to trigger a function but the body is always empty. I set
RAW_BODY
totrue
but it is still empty. Is there another way I can try to solve this issues ?here is the log of the function request: