Ionic serve VS ionic build ios

My code gets data from my server and displays the app perfectly if I run “ionic build ios” and view in the simulator, but if I run “ionic serve”, only what is displayed in codepen shows in the browser. Anything I can put in my code so the data from my server shows in the app on both? Thanks, Ben

Anyone able to help me with this issue? Thanks, Ben

are there any errors in browser console?
when you run your app in browser, your request header have different origin from requested resource header
read about CORS in Ionic

1 Like

blablapolicja beat me to it. You are getting CORS errors in the console. There is a plugin for Google Chrome that I use for this: CORS plugin

See this post, too.


THANKS to you both! (Needs more characters)