大家好,我想请问一下最近在看nodejs up and running 一书,书中的tweet的例子好奇怪.里面有段代码如下:
app.get("/", function(req, res) {
    var title = "Chripie",
        header = "Welcome to papa";
    res.render("index", {
        locals: {
            "title": title,
            "header": header,
            "tweets": tweets,
            stylesheets: ["/public/style.css"]
        }
    });
});
我怎么运行怎么都没有locals里面的选项出来。。奇怪了。。还有就是书中的layout.ejs按照我的理解应该是这个layout.ejs是主要的模板然后index.ejs都是显示在里面的<%- body %>部分的呀。。怎么运行得奇怪。。? 附上layout.esj代码
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    
    <title><%= title %></title>
</head>
<body>
    <h1><%= header %></h1>
    <%- body %>
</body>
</html>
请教各位大神指导下,谢谢。。
 
       
    