Pug - 无法通过样板的第 1 步
完全是菜鸟问题,但我找不到任何解决方案,抱歉,所以最后的办法是在这里提问。
我正在努力学习哈巴狗。已创建样板项目,无法呈现索引页。我已经尽可能多地搜索和阅读,但我得到的只是“解析 with 表达式的正文时出错”错误。 index.js 看起来很简单,如下所示,但让我停了下来:
var express = require('express');
var router = express.Router();
// GET home page.
router.get('/', (req, res) => {
res.render('index', { title: 'Express' });
});
module.exports = router;
如果有人可以提供一条线路来为我指明正确的方向来解决这个问题,并继续我的哈巴狗和 Nodejs 之旅,我将非常感激。哈巴狗在这个阶段显得非常困难,尽管大家都对它赞不绝口:/
total noob question but I cannot find any solutions to this sorry so last resort is to ask here.
I am trying to learn pug. Have created a boilerplate project and unable to render index page. Ive searched and read as much as I can but all I get is 'Error parsing body of the with expression' error. The index.js looks as simple as follows but stopping me in my tracks:
var express = require('express');
var router = express.Router();
// GET home page.
router.get('/', (req, res) => {
res.render('index', { title: 'Express' });
});
module.exports = router;
if anyone can provide a one liner to point me in the right direction to resolve this and keep rolling on my pug and nodejs journey I'd really appreciate it. Pug is appearing very difficult at this stage despite all the raving about it :/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我检查了我的一个旧项目。您可以尝试这样的操作:
安装 pug:
然后设置应用程序:
示例 pug 文件:
使用模板引擎
I have checked one of my old projects. You can try something like this:
Install pug:
Then set up the app:
Example pug file:
Using template engines