Http request not working on device but works on cordova browser

I’m working on an app with a node js server (localhost) and my app works fine with

ionic cordova run browser

But it’s not sending request to the server when I run on my android device with the command

ionic cordova run android

I resolved my problem by changing my localhost url to the ip address
back_end_URL: ‘http://localhost:3000/
back_end_URL: ‘