Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Is it considered a best practice to have multiple front ends (iOS, android, web) access the same API?

I'm developing an application that currently has two front ends: a responsive website and a iOS app. The website is written in plain old HTML, CSS, JavaScript, and the iOS app is being written in Swift. The back end for this application was already built using a LAMP stack.

Now my question: is there anything wrong with having the iOS app and the web app access the same API? For example, one of the API endpoints takes in some information about the current user, queries a database, and returns a JSON object plus some data (a photo). Is there a potential for something going wrong if I have web browsers and iPhones talking to the same API? Or is that a good thing (DRY programming)? I tried googling for an answer and I found most of the info to be way too advanced. I'm still a newbie to programming, after all. Thanks!