InterviewSolution
| 1. |
What Is Koa.js Templating? |
|
Answer» Pug is a templating engine. Templating engines are used to remove the cluttering of our server CODE with HTML, concatenating strings wildly to existing HTML templates. Pug is a very POWERFUL templating engine which has a variety of features including filters, includes, inheritance, interpolation, etc. There is a lot of ground to cover on this. To USE Pug with koa, we need to install it, $ npm install --save pug koa-pug Now create a new directory called views. Inside that create a file called first_view.pug, and enter the following data in it. doctype html Pug is a templating engine. Templating engines are used to remove the cluttering of our server code with HTML, concatenating strings wildly to existing HTML templates. Pug is a very powerful templating engine which has a variety of features including filters, includes, inheritance, interpolation, etc. There is a lot of ground to cover on this. To use Pug with koa, we need to install it, $ npm install --save pug koa-pug Now create a new directory called views. Inside that create a file called first_view.pug, and enter the following data in it. doctype html |
|