Database Request API For Angularjs

Asked

Viewed 1,043 times

2

What API’s to make requests with database (mysql preference) that I have available to work integrated with Angularjs, some that is simpler to use and that runs on any server, I was going to use the nodejs but the servers to run it are more expensive and I can not afford it at the moment...

Remembering that I am a beginner developer and my base language is PHP

  • You can build your API on PHP same, and only at the time of returning the database transactions do a parse for JSON and consume data in Json at angular.

  • How so api to connect to the database and you do not want to do this on the server? Angularjs runs on client, browser, there is no api for you to connect to in a remote database, you need to write a server code to do this. If you use php, write a code in that language that accesses the database and then runs that code from a call ajax of angularjs.

1 answer

2


Basically you could use any API you wanted to work with Angularjs, it makes no difference what technology you will use on the server side because in the end it is a Webservice that transmits only data (in JSON format preferably).

Since you already have experience with php and are a beginner developer, there are some technologies that would suit you, for the simplicity and ease of handling, however there is no escape from understanding the operation of web applications and some tools that are used in these applications.

Therefore, to facilitate all the work, you would need a micro-framework (a more simplified or minimalist version of a web framework) and a ORM for php. Fortunately, in this we have a wide variety of free and open source frameworks and Orms, so it won’t be hard to choose one.

I particularly recommend the set offered by Laravel, which is the micro-framework Lumen together with the ORM Eloquent. However, several frameworks also support this combination, for example, Phalconphp and Fuelphp, and others that offer these tools alone as Slim for micro applications and the Doctrine as ORM.

At the end of the day, it turns out to be a matter of opinion, each one must choose the framework that best serves their needs and conveniences. But for example, if you use Lumen with Eloquent, your application takes on a much cleaner and more intuitive design than in pure php.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.