You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
express 环境下的实例写得有问题,希望能够完善一下。
我按文档配置模板引擎代码下
app.engine('art', require('express-art-template'));
app.set('view options', {
debug: process.env.NODE_ENV !== 'production'
});
报错:
(node:11512) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: No default engine was specified and no extension was provided.
(node:11512) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:11512) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: No default engine was specified and no extension was provided.
express 环境下的实例写得有问题,希望能够完善一下。
我按文档配置模板引擎代码下
app.engine('art', require('express-art-template'));
app.set('view options', {
debug: process.env.NODE_ENV !== 'production'
});
报错:
(node:11512) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: No default engine was specified and no extension was provided.
(node:11512) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:11512) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: No default engine was specified and no extension was provided.
一定要用以下方式才可以生效
app.engine('.html', require('express-art-template'));
app.set('view engine', 'html');
但这样配置我不明白参数如何配置?按照你提供的文档配置似乎没有生效,还有如何自定义自己的过滤器?
app.set('view options', {
debug: process.env.NODE_ENV !== 'production'
});
The text was updated successfully, but these errors were encountered: