If you, too, were upset with the Let build twitter programming tutorial in chapter 2 of O'Reilly Up and the working book, here is an addition to make this “application” work.
Prerequisites:
- For this application to work, make sure you have an Express version <3.x. In fact, in version 3.0 and above, they removed the "partial" support, and now it is template specific. Therefore, do not forget to install version 2.x:
npm install express@2.x - The book does not contain any information on how to use EJS files. After a little research, to express, to understand and analyze the EJS file, you need to install ... ejs. Installation is fairly simple, just like any other module:
npm install ejs.
Meat:
views partials .ejs- EJS, express EJS
app.render()
:
(1) EJS , express
app.set('view engine', 'ejs');
res.render('index', ...)
(2) app.render() EJS,
res.render('index.ejs', ...)
, , . Fork .
, .