Skip to content
Advertisement

Tag: express

Passing parameters to Express middleware not working

I’m trying to create an input validation middleware using Express. My goal is to be able to pass 2 parameters to the middleware that validates client input. The problem is, after following multiple resources (including Express docs), my middleware seems to not be working. After calling the middleware, I get to the “first console log”, but never to the second,

Making a signup form and login form using express server

So I am basically making a simple website on my localhost that has a signup form and some other html elements. I managed to setup the signup process smoothly. So when the user fills in the form and submits it to the root route(“/”), an email is sent to the subscriber containing a random password using nodemailer and then the

Node express API not get in response?

I have created a node-express API. And I request using fetch like this In Network tab I got the same JSON object send from server. In console log of resonpse it print below things…. How can I use the JSON data that send from the server? Answer To get the actual data, you need response.json() like this to actually read

Cast to ObjectID failed – mongoose

Hi I am trying to add an event to a users profile once they click on the event. I am getting the following error – Cast to ObjectId failed for value “{ event: ‘600066640807165d042b91dd’ }” at path “event”. The route for creating a profile and for creating an event work as expected. The 600 is the id of an event

Advertisement