Now, mostly when we will use express. We will use it for 2 things: either to setup APIs or for templates with Server Side Rendering (SSR).

What are differencer between them:

Differences between APIs and SSR:

Screenshot 2022-08-27 at 5.50.55 PM.png

APIs (Application Programming Interface):

The main idea here is that our server will provide data, and what that means that any frontend app that wants to access it and use it can simply perform a http request, and using our data setup the API and functionality.

APIs can be used in any type of frontend, like react, angular, vanilla js project, etc. It dosen’t matter.

Basic JSON API example:

Screenshot 2022-08-27 at 7.07.21 PM.png

Screenshot 2022-08-27 at 7.08.05 PM.png

Here, you can see we have the very basic response from the server.

We can use the data.js provided in the repo for this example:

Screenshot 2022-08-27 at 7.11.03 PM.png