I have setup a private registry v2 which is running inside a container and also setup a notification listener for it, which is written in nodejs. But the problem is that notification request body is always empty and i am not able to figure out the problem .
So any suggestion or help would be really helpful.
if the application is node js then the data send by the registry is received as a buffer. All you should do is convert it back to String
Assuming that you have asked the private registry notification listener to send notification to the /notification url
Here is an example
app.post("/notification", function(req, res) {
//If you use req.body it will print empty flower brackets
console.log(req.body); // this will print empty {}
//Instead use the below
req.on(‘data’, function(data) { // data here is buffer
console.log(data.toString(‘utf8’);
});
res.sendStatus(200);
});