Skip to content

Tag: express

Difficulties to make another route expressJS

I am doing a site as of my studies. The technology being free, I decided to code with nodejs/Express. For my first route /home, everything went well. But I can’t create others. Yet I thought I understood the system well. It would bother me if it was due to a silly error because I have been on this probl…

Resolve promise inside javascript map function

I have gone through several questions and posts regarding how to accomplish this but none have worked. I have tried an array (no pun intended) of possible solutions involving Promise.*, thenable, await and none have worked. I have an array of payments that I extract from a Prisma db call, the object looks lik…

Handling complex query parameters Express.Js

I’m making REST APIS with Express.js I have the following express route: /api/customer I added multiple query params to the route like this: In my controllers I handle all of these with If and there are so many cases I feel that this method would not scale, is there a better way of handling this ? This …

API call in express says maximum rows exceeded

I have an express app that makes an api call and prints out the results like so: The issue now is that once the API call is made, the result says Limit for result exceeded, max rows: 25.00 thousand, current rows: 40.11 thousand I know that you can increase the file size, but I don’t think that also incr…

Get buffer from post body in Expressjs

I am making an express application that handles post data. Because the request body could be any content type and/or binary, I would like req.body to be a Buffer. So what should I use to get a Buffer that represents the request body? Here is my code: Answer body-parser can help achieve this, code example woul…