A template engine enables you to use static template files in your application. At runtime, the template engine replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the client. This approach makes it easier to design an HTML page.
Some popular template engines that work with Express are Pug, Mustache, and EJS. The Express application generator uses Jade as its default, but it also supports several others. (From express official Document)
There are many different templating engines
We can use any of them to do the frontend while making the api.
I’m going to use EJS to show you how to do this.
Start with the official page – https://ejs.co/
You can check the features of it
Installing it is super easy
So finally our package.json
You can see the graphical version here