• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue My Node.js backend returns servers' automatic HTML error page, instead of my res.json error message

levni00

New Pleskian
I have a REST api on the Node.js(express) server and React app for front-end. I have designed it to send JSON to front-end when faces an error, it sends it and I can use it to print errors on the client side as a modal etc.
On Localhost there is no problem. But after uploading to the server, when I left empty spaces or submit false password etc, it never sends my JSON responses, instead, it returns servers Html Page. I console.logged returning error response and it is something like this:

Ekran Görüntüsü (38)_LI.jpg

How can I disable this error responses to allow my own REST API works correctly?
 
Back
Top