Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you too have been frustrated with the "Let's build twitter" programming tutorial at the Chapter 2 in the O'Reilly Up and running book, here is the complement to make this "app" work.</p> <p>Pre-requisites:</p> <ol> <li>For this app to work, make sure you have a version of Express &lt; 3.X. In fact, in version 3.0 and higher they removed the "partial" support and now is template specific. So make sure to install a version 2.x by doing so: <code>npm install express@2.x</code></li> <li>The book doesn't provide any information on how to use EJS files. After a bit of research, in order for express to understand and parse EJS file you have to install...ejs. The installation is pretty straightforward like any other module: <code>npm install ejs</code>. </li> </ol> <p>The meat:</p> <ol> <li>For this app, all the files in the folder <code>views</code> and <code>partials</code> should have the extension .ejs</li> <li>You installed EJS but you have to tell express to use EJS as the template format in the <code>app.render()</code> function You have two ways to do it: </li> </ol> <p>(1) You set EJS as the default template engine and then just tell express to render your file <code>app.set('view engine', 'ejs');</code></p> <p><code>res.render('index', ...)</code></p> <p>(2) You just tell to the <code>app.render()</code> function to use EJS, express will take care of it</p> <p><code>res.render('index.ejs', ...)</code> </p> <p>If at that point it doesn't work or it's still not clear, nothing is better than looking at working code. Fork or download the app <a href="https://github.com/tinnou/twitterApp">here</a>.</p> <p>Hope it helps other readers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload