I’m running my Backend on Kubernetes on around 250 pods under 15 deployments, backend in written in NODEJS. Sometimes after X number of hours (5<X<30) I’m getting ENOTFOUND in one of the PODS, as follows: I’m running a stress test on the Backend of YY number of users per second, but I&…
Tag: node.js
How to rename file in Multer middleware to data I am sending in request
On a frontend I am generating unique ID for every order. Idea is to rename file which user uploads to orderId. Here is my request to server: Here is the server code: console.log(req.body) shows empty object in filename and orderId in app.post(). Here is how it looks: So this cannot be done as far as I underst…
How to integrate Azure Voice API in node.js
Now I am integrating Azure Voice API in my MERN stack project. I tested it in console with debugging but it doesn’t work on React Website. I am not sure what’s the problem. Answer To use Azure Voice Api, You need to get the authorize from the Azure Support team. If you didn’t get it, you can…
Key from one Json file to value of another Json file using node/Javascript
I tried and searched to make a JSON file who’s keys are data in other JSON file for eg: admin in user.json is the key but it will act like value inside the Schema.json file same other keys which are present inside the user.json file will act like value inside Schema.json file. suppose I have user.json n…
FATAL ERROR: v8::Object::SetInternalField() Internal field out of bounds on Node js using node-cache
I have a api export with a lot of data so I tried to used the node-cache so the api will be faster since take more than 2 min to get the data, I am new on this so I found the follow code: Notes: env node js/express Any suggestion or recommend will be great! Answer The solution was using
Promise.all convert result with parameter from nested loop
The following loop to call an async function, here a smart contract interaction using web3. I want to get the balance of an array of token by calling balanceOf() and convert it subsequently with the attached usdrate. For parallel processing I am using Promise.all. Obviously, the function below Promise.all() w…
How can I return my data in this nested promise model?
I have this function, I created it but then I’m getting confused and don’t know how to return the data. I have tried Promise.all() before but it’s seems I do not quite understand it so I have removed it from my code, I don’t know if it’s a correct way to do it or not. I’m f…
Why I cannot map over this array of objects in React JS?
Why I cannot map over this array of objects in React JS? Here’s my code: The code in quotations is working but map is not. Answer You are missing a return statement on the map so you are not able to get the output. You can do it as follows.
TypeError: Cannot read property ‘delete’ of undefined
I am getting an error (Cannot read property ‘delete’ of undefined). It’s probably an easy fix but I can’t seem to figure out how to fix it. The error: My code: Answer The problem is that you try to destructure the first parameter of the callback, which is a Message object, and a Messag…
Maximum Call Stack Size exceeded and ENOENT error while using context
I get this error whenever I try to use React context,provider or useContext, any of them causes this On App: On terminal: Answer Path to context is wrong. Basically I import ContextFile.js to index.js, and from index.js access to many things. index.js was importing Context from itself, and not from ContextFil…