Web Development – Employer Asking to Use API for Entire Website

web-development

I'm working with an ASP.net developer, under a boss who doesn't have much technical knowledge. I'm doing the front-end work, and and a database expert doing the backend.

However, recently, he said that he would be working on the API for our site- I asked why, thinking we should do the web version first, assuming the API was for mobile apps. However, he said that he would just make a single API to work for all the web and mobile apps, and I would do the front-end for that.

Is it just me, or is this a little crazy? If I'm doing front-end, it means there's going to be two back-ends, because I'm going to have to use PHP or something to curl his API to the site, which is twice the loading time as normal.

Thank for any help in advance. Also, I happen to be "the intern", so I'll have some but not very much pull with this issue.

Best Answer

Consuming your own API is a common case. It is often called Eating your own dog food if I remember well.

Currently, I am doing the same thing for a project. I have created my Data Access Layer library, and I won't be using it directly on my web project. Instead, I will create REST APIs to reach out the data from my web site.

How I handle the authentication is another issue. What I will do is to give myself a APIKey as I will give others and go from there.

What advantages does this bring? Well, I will be handling statistics over the REST APIs and I really don't want to do the same work again. Also, by this way, my only data access concern is my API project.