A large part of application development for the web has to do with what is called back-end.
We can think of back-end as applications that communicate with one another. In web development, back-end is a service that sends data to the front-end.
When we create a front-end application, we create an interface for the user to interact with. That interface is made of components like buttons, dropdown menus, pages, fonts, etc.
The back-end also has an interface, but this interface is not used (or consumed) by the end user. It's used by other applications.
Back-end applications often include databases but they don't have to. They are any kind of service (data, computation, actions, activities, events) that need to occur in support of other applications needs.
API is an acronym that means: Application Programming Interface.
It's the interface that is used by an application, typically a front-end application, to talk to the back-end application.
API are methods and functions that wrap some operations.
We normally talk about APIs in the context of internet network applications, but API is a more generic term that describe interfaces between any kind of applications.
For example, an application like Axios has an API that it uses to communicate with other applications.
Sometimes API are
synchronous, meaning that we have to wait for their response to our requests before we can continue our operation. Other times APIs are
asynchronous, which means that their responses can come at a later time so we can continue with our work while waiting for the response.
Some API never reply back. In this case it's our responsibility to check with them periodically to see if a request has succeeded or not.
One common type of API we have these days is called
REST stands for Representational State Transfer.
These are APIs that are meant to leverage the infrastructure of the internet by using the
HTTP (Hypertext transfer protocol) is the protocol used on the internet, and by using
APIs we gain all the benefits of that infrastructure that's already built and tested on a large scale.
HTTP protocol specifies that any request made by an
HTTP client includes a verb in that same request. The verb indicates to the server what kind of action we ask the server to perform.
There are several
HTTP verbs, but the four most common ones are
HTTP request we also provide other information, along with these verbs, that tells the server what it's supposed to do.
GET verb will tell the server "Get something and return it to me"
POST says: "I'm giving you information, I want you to save it"
PUT does a similar thing as
POST, but it's used to update existing information.
DELETE verb tells the server "I want you to remove something".
Typically these kinds of exchanges happen within the context of a browser / web server interaction, but working with back-end application we create
HTTP servers that are not web servers and we use
HTTP clients that are not browsers.
APIs very often have to deal with data and there are four basic functions that we can perform with data:
- Create data
- Read data
- Update, or change, data
- Delete data
Those four functions are represented in an acronym called
Each of those four functions has a correlation with an
- Create ->
- Read ->
- Update ->
- Delete ->
There are a myriad of applications that are used to develop and run back-end services, let's take a very quick look at the two main ones we are going to use.
Express is a
Node.js application used to make
It's possible to use other libraries, but Express makes it very easy to create and send
HTTP requests with Node.
We will see how to create and use back-end applications with
Express in the following articles.
I write daily about web development. If you like this article, feel free to share it with your friends and colleagues.
You can receive articles like this in your inbox by subscribing to my newsletter.