I have my backend for a project in Node.js which is deployed on AWS EC2 instance it works correctly on all the APIs, but when the server is down due to any reason, a CORS error gets reflected on the client side Networks Tab in Inspect.
I don't know why we are getting CORS error, on my local when the server is not up and I run the frontend app, it gives (failed)net::ERR_CONNECTION_REFUSED
error which is correct since the server is not up. So, why am I getting CORS Missing Allow Origin
on Prod environment when the server is down.
I expect that when the server is down in Prod environment the client side should get message like Server is Down
or any custom message in the Networks Tab of inspect instead of CORS Missing Allow Origin
error.
Any solution or suggestion is appreciated.