How to access rest api in Ionic 2?

I’m trying to access an API from Ionic 2 app but getting an error. Enabling cors Access control allow origin-> * on server side works but it will make APIs insecure. Is there any URL for Ionic 2 app that I can enable from server side?