I am trying to find the best way to structure a new project that I am about to start.
We currently have a web application and a mobile application that both transmit API data. Currently, the web application runs during the installation of CodeIgniter, and the API runs on a separate installation of CodeIgniter. For data, the web application makes API calls and then processes the returned data.
At the moment, it looks like we're doing to switch to Laravel for a web application, and I thought it might be a good opportunity to remake the API as well, as some of our rules have changed, and maybe it's time to get CodeIgniter turned off altogether.
Now to the question: I read several sources of people who build their web application and API in the same Laravel project, and simply use routing to control the display of the API and the web application separately. Although this seems like an interesting idea, it makes me wonder if this is best practice, since I would like to wonder if heavy API traffic will slow down the web application and vice versa.
Question:
Would it be best practice to support api in a separate project or would it be nice to do this in one project?
Follow up question
To make a call from a web application through an API, if it is not disconnected, is it just an API route call? Better go through classes?
source
share