NodeJS + Express + Handlebars - failed to locate view “index.html”

筅森魡賤 提交于 2019-12-03 01:52:59

By default, it will look in a folder called views from the directory the script is. If you use a different dir you must specify it.

app.set('views', __dirname + '/views');

Express should also tell you more information about where it's trying to find the view, that should help you know exactly where it's looking.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!