当前位置:网站首页>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
边栏推荐
- Android high-level interview must ask: overall business and project architecture design and reconstruction
- Probabilistic model of machine learning
- JDBC JDBC
- Fashion MNIST dataset classification training
- Efficient music format conversion tool Music Converter Pro
- Niuke hand speed monthly race 48 C (I can't understand the difference. It belongs to yes)
- Innovation and management based on Scrum
- 基于多态的职工管理系统源码与一些理解
- leetcode 烹飪料理
- 第46届ICPC亚洲区域赛(昆明) B Blocks(容斥+子集和DP+期望DP)
猜你喜欢
hack the box optimum靶机
定了,今日起,本号粉丝可免费参与网易数据分析培训营!
本地远程访问云服务器的jupyter
Leangoo brain map - shared multi person collaborative mind mapping tool
高效音乐格式转换工具Music Converter Pro
Huashu "deep learning" and code implementation: 01 Linear Algebra: basic concepts + code implementation basic operations
[hcip] detailed explanation of six LSAS commonly used by OSPF
Interim summary (Introduction + application layer + transportation layer)
谷雨
[wechat applet] set the bottom menu (tabbar) for the applet
随机推荐
SQL server2019无法下载所需文件,这可能表示安装程序的版本不再受支持,怎么办了
[suggestion collection] hematemesis sorting out golang interview dry goods 21 questions - hanging interviewer-1
Probabilistic model of machine learning
Leetcode cooking
php+mysql對下拉框搜索的內容修改
JVM class loader
JZ35 replication of complex linked list
[unity3d] rolling barrage effect in live broadcasting room
Rich intelligent auxiliary functions and exposure of Sihao X6 security configuration: it will be pre sold on April 23
PIP install shutil reports an error
windows MySQL8 zip安装
解决 注册谷歌邮箱 gmail 手机号无法用于验证
Planning code ROS migration POMDP prediction planning (I)
How big the program development of single chip microcomputer project can be, it represents your level of knocking code
JZ76 删除链表中重复的结点
MySQL复杂查询使用临时表/with as(类似表变量)
[XJTU计算机网络安全与管理]第二讲 密码技术
牛客手速月赛 48 C(差分都玩不明白了属于是)
How to build an integrated industrial Internet plus hazardous safety production management platform?
Android 高阶面试必问:全局业务和项目的架构设计与重构