当前位置:网站首页>The express project changes the jade template to art template
The express project changes the jade template to art template
2022-04-23 02:45:00 【Zero】
-
install
npm install --save art-template
npm install --save express-art-template
(express-art-template Depend on art-template) -
Specified in .html The parsing engine used at the end
app.engine(‘ Resolve the suffix of the file ’, require(‘express-art-template’)) -
To configure , As follows
// The first parameter is HTML Call the template engine... For the end
app.engine('html', require('express-art-template'));
app.set('views', {
debug: process.env.NODE_ENV !== 'production'
});
// Set the template path of the template engine
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'html');
Be careful :
app.engine() The first parameter of should be related to app.set(‘view engine’, ‘html’) The second parameter in should be consistent .
版权声明
本文为[Zero]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220744163052.html
边栏推荐
- Deploying sbert model based on torchserve < semantic similarity task >
- How to solve the complexity of project document management?
- [XJTU计算机网络安全与管理]第二讲 密码技术
- Global, exclusive and local routing guard
- 解决 注册谷歌邮箱 gmail 手机号无法用于验证
- Win view port occupation command line
- PIP install shutil reports an error
- 工业互联网+危化安全生产综合管理平台怎样建
- JZ22 鏈錶中倒數最後k個結點
- leetcode 烹饪料理
猜你喜欢

The way to conquer C language

C语言 171. 最近回文数

Interpretation of the future development of smart agriculture

Flink stream processing engine system learning (III)

认识进程(多线程_初阶)

Interim summary (Introduction + application layer + transportation layer)

Modification du contenu de la recherche dans la boîte déroulante par PHP + MySQL

SQL server2019 cannot download the required files, which may indicate that the version of the installer is no longer supported. What should I do

Deploying sbert model based on torchserve < semantic similarity task >

Fashion MNIST 数据集分类训练
随机推荐
How can enterprises with major hazard installations ensure the completion of the digital construction task of double prevention mechanism by the end of the year
想用Mac学习sql,主要给自己个充足理由买Mac听听意见
第46届ICPC亚洲区域赛(昆明) B Blocks(容斥+子集和DP+期望DP)
Linux redis - redis ha sentinel cluster construction details & redis master-slave deployment
1、 Sequence model
[wechat applet] set the bottom menu (tabbar) for the applet
Rhcsa day 4 operation
Flink stream processing engine system learning (I)
Flink stream processing engine system learning (II)
Cuisine leetcode
解决win7 中powershell挖矿占用CPU100%
Using go language to build web server
全局、独享、局部路由守卫
Interpretation of the future development of smart agriculture
The interface request takes too long. Jstack observes the lock holding
Probabilistic model of machine learning
下载正版Origin Pro 2022 教程 及 如何 激 活
接口请求时间太长,jstack观察锁持有情况
Solve the problem that PowerShell mining occupies 100% of cpu7 in win7
Parental delegation model [understanding]