简体   繁体   中英

Express res.render breaks extends layout when using deep url paths

If I stay one level deep in my app /level1 and call res.render(myPage.jade) everything runs great but when I go to /level1/level2 res.render(myPage.jade) I get 404s on all my css/js and my styling breaks.

Folder Structure

  • views
  • pages
  • pages/myPage.jade
  • layout.jade

mypage.jade

extends ../layout

您必须对资源尝试使用绝对链接/css/...而不要使用css/... (与js文件相同)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM