我的项目使用nodejs&expressjs和mongoose编码。它具有以下结构:
| models
| public
|images
|javascripts
|stylesheets
|routes
|account
|login.js
|register.js
|index.js
|views
|account
|login.js
|register.js
|partials
|header.jade
|footer.jade
|leftsidebar.jade
|layout.jade
|index.jade
下面是我的layout.jade
doctype html
html
head
meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
link(rel="stylesheet", href="/stylesheets/style.css")
body.home-page
include ./partials/header
//-.div-advertisement
.body-content.wrapper-all
include ./partials/leftsidebar
block content
include ./partials/footer
所以当我尝试进入带有链接的页面login.jade
localhost:3001/account/login
不会在style.css中显示图像,当我检查图像时,浏览器会转到此链接 本地主机:3001 /帐户/图片/ .... 但是图像文件是公开的 所以我认为路径继承有问题