As you can see it returns a value; a JSON representation of a form. So far, so good, when requesting the endpoint it returns 200 OK and the correct JSON. However:
After sending the response the code looks to still call next(). As far as I can tell it shouldn't because I've returned a value from the service call, right? It should res.send() and be done.
I have a route in a service:
As you can see it returns a value; a JSON representation of a form. So far, so good, when requesting the endpoint it returns
200 OK
and the correct JSON. However:After sending the response the code looks to still call
next()
. As far as I can tell it shouldn't because I've returned a value from the service call, right? It shouldres.send()
and be done.