Assuming the Pug code is in `views/test.pug` Use `pug` to preprocess all calls to `res.render()`. Refers to the npm module you want to use as your template engine. Note the app.set('view engine', 'pug') call is how you tell Express to use Pug for templating. Below is how you can use Express to render test.pug for Suppose the above code is in the views/test.pug file. Pug is a whitespace-sensitive HTML templating language that supports loops and conditionals. Pug (formerly known as Jade) is one of the most popular templating engines forĮxpress. In this tutorial, you'll learn how to add Pug as a template engine,Īs well as how to write your own minimal template engine that enables Express to work with Vue's server-side rendering. Seamlessly with popular templating engines, like Pug, Mustache, and others. Template engines allow you to configure Express to work
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |