June 2014
Intermediate to advanced
696 pages
38h 52m
English
Once you have a template engine defined and configured and have created your templates, you can send a rendered template by using the Express app object or using the Response object. To render a template in the Express app object, you use the app.render() method, shown below:
app.render(view, [locals], callback)
The view parameter specifies the view filename in the views directory. If no extension is included on the file, the default extensions, such as .jade and .ejs, are tried. The locals parameter allows you to pass in a locals object if one has not been defined in app.locals already. The callback function is executed after the template has been rendered and should accept an error ...
Read now
Unlock full access