![]() in the link handler index.js added the correct paths to the templates after updating the folder structure and pug files in the views folder. Path.join(_dirname, '/views/public/fragments')]) Īpp.use(express.urlencoded( ![]() ![]() The name was changed from Jade to Pug due to a trademark issue in 2016, when the project released version 2. Jade is the old version of Pug, specifically Pug 1.0. Template engines allow us to add data to a view, and generate HTML dynamically. Path.join(_dirname, '/views/public/templates'), Express is capable of handling server-side template engines. This is the structure of my folders and, the contacts.pugtemplate is not visible for render()Īpp.js const createError = require('http-errors') Ĭonst cookieParser = require('cookie-parser') Ĭonst indexRouter = require('./routes/index') Ĭonst usersRouter = require('./routes/users') Īpp.set('views', [path.join(_dirname, '/views'), ![]() I make the structure of folders and views then the internal templates are not visible for rendering. When all the templates are in the views folder then we successfully render them. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |