i have a API called /validate which returns true or false value . I want true/false reponse to use in other API in nodejs .Please help
app.get('/validate',new TestController())
above api will give response like true or false
now in below api i want to call /validate and according to reponse i want to send result to user
app.get('/check',new Validator())
i used require('request') but getting error not found
/validateroute and beak it out into a function that can be called separately from a route so you pass it some input and it returns some output from the function. Then, you can call that function from both routes and reuse the same code in two places without having to actually make another TCP request. This is called "factoring common code" so it can be used in multiple places.