Ionic 5: Http calls doesn't work on android/ios simulator but works fine in the browser

I have a project using ionic 5. my HTTP calls works fine when I’m running on the browser but doesn’t work on either android or ios simulator. I keep getting
OPTIONS http://localhost:5001/endpoint net::ERR_CLEARTEXT_NOT_PERMITTED
When I used chrome://inspect. Any fix for this?
Please help!!!