I have a new EC2 instance in AWS where I’m hosting a webpage too. i associated the instance to a security group, and some rules work (like connect to mysql or vesta). I have created a simple server with nodeJS and I want to listen a request from port 8085 (I could choose any….). I have create a in…
Tag: node.js
Ioredis: When reconnecting redis via connect() , calling connect doesn’t reset retry times to 0
I have following options set when connecting to Redis Later on, I am exporting this client throughout project for redis queries. The issue is when Request 1 comes and there is some issue with redis, it tries to auto-connect for 4 times(+1 for initial try). Then throws error which is handled. So for now times …
“TypeError”: Cannot read properties of undefined in Vuejs?
It works like this: I have a table made in Vue, where I have some select options. This error appears when I have a grupo (group) and this group is not associated with a maquina (machine), what shouldn’t happen, the objective is that only “-” appears. Throws an error in the console and does n…
express.js How suspicious should we be of req.body?
https://expressjs.com/en/4x/api.html states As req.body’s shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, req.body.foo.toString() may fail in multiple ways, for example foo may not be there or may not be a st…
Using async functions as conditions
Lets say i want to run an if statment where the condition is async function. This is the function, it uses mongoose findOne which is an async task. The problem is that the if statment gets called before the con can get executed which then does’nt set the condition. Answer You can do it this way : Return…
Checking if a message was sent from a DM channel type not working
I am using Discord.js v12 and trying to check if a message was sent from a DM but it doesn’t work for me, I have tried this method: This was working fine couple months ago but it doesn’t work anymore. When i try console.log(msg.channel.type) it only returns text and doesn’t return dm when th…
How to get bcyrpt compare in a promise to work right?
I’ve had this working before, but now it’s broken for some reason. I’m using MariaDB as a database, and need to compare passwords, but it’s giving me an error Unexpected Identifier on “bcrypt” after await. When I remove the await, it works, but even if the password is wrong…
Cant start angular project
I was having some problems with an angular project so i reinstalled nodejs and angular cli however now when i try to run ng serve i get this error: enter image description here now ive done the typical google searching for this problem and it led me to stackoverflow with making sure the nodejs is in the envir…
React is not getting uninstalled in windows
I am not able to uninstall react app in windows 10. I tried everything which is in stackoverflow but it is not getting uninstalled. I am using npm . Even I removed nodejs, still it is not working. I actually need to use latest version so when I installed nodejs and react again it is still picking old version …
How to check if array of objects that contains another array of object has property
Hi I have an array of objects which contains another array of objects. I need to find an object in array which contains another object in it’s array with certain propery ID. Let’s say i need to find an object in casses array which contains a user with certain ID. ID for user is unique. I could use…