-2

这是我尝试观看时出现的错误

在此处输入图像描述

这是代码:

doctype
html
    head
        title Express JS
    body
        h1 Welcome to Express JS site.
        p= name
        ul#nav.bakri
            li.lelii one
            li two
            li.peduu three
        h2 Spectacular Mountain
        img(src='image.jpg', alt='Mountain View',
        style='width:304px;height:228px;')
4

1 回答 1

0

您必须为 image.jpg 文件夹设置静态路径

app.use(express.static(path.join(__dirname, 'public')));  // image.jpg in "public" folder

在模板(jade 或 bug)集中

src='/image.jpg'
于 2016-05-20T09:00:27.380 回答