Handling Mongoose Query Errors in Express.js

So let’s say I want to make a Mongoose query to a database, inside of an Express post route: app.post(“/login”,(req,res)=>{ const username = req.body.username const password = req….

Propper way of Error handling in a nodejs API server

I need to handle errors in my API server on node.js. I created a error handling module, which sends the errors (only in dev mode) to the API client in a JSON object similar to this: { “status&…

Problem with fetching data from Spring Boot API endpoint using Java Script

I work on web application and encountered an issue with fetching data from an endpoint using Java Script. If I type endpoint adres in a browser it works perfectly fine but somehow it does not work in …

Im getting an error in my react and rest api app where one of my variables is coming back undefined

thank you for your time if youre reading this, im making a full stack app with react and rest api and im encountering an error as such: TypeError: errors is undefined submit UserSignUp.js:53 …

What is a good way to pass many parameters to controller?

I have an application on Java (Spring framework) and Javascript (AngularJs framework). There are list of objects in the table and two text fields for filtering this objects. Filtering happens on the …

The post request works in Postman and in cURL but not in Angular

I have a remote server and a local client which sends a simple post request with one header Content-Type: application/json and with the body ‘{“text”: “hello”}’. The server code …

API called twice while useEffect triggered once. ReactJS/Javascript

i am building a project, in which when user click the buyNow button in Basket (child 2) it will pass the props back to parent where it further pass it to another child in Signin(child 3) where we call an API call(inside useEffect) to update the mysql database but it seems that the API call is called twice as in database two records are being created and in front end i got two identical invoices record but different file names. Any suggestion guys why i am facing this, please note if i remove the useEffect statement from the Signin it

Cypress: Re-use auth token across multiple API tests

I have a Rest API which generates a token. This session token is used across multiple REST API’s as an authorization Bearer token. I used this as reference: https://github.com/cypress-io/cypress-…

extend existing API with custom endpoints

I’m creating an API for multiple customers. The core endpoints like /users are used by every customer but some endpoints rely on individual customization. So it might be that User A wants a special endpoint /groups and no other customer will have that feature. Just as a sidenote, each customer would also use his own database schema because of those extra features. I personally use NestJs (Express under the hood). So the app.module currently registers all my core modules (with their own endpoints etc.) I think this problem is not related to NestJs so how would you handle that in

cannot access objects inside service response

When I tried to access the JSON response I cannot access the object. I need to get the target and datapoint objects and after that I need to iterate the dataPoint array. result.target is undefined …