You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
571 B

// express官方微了art-template模板引擎更好的适用于express,在其基础上封装了press-art-template
const express = require("express")
const app = express()
// 当渲染后缀会art的模板时,实用express-art-template
// 可以使用多种模板引擎
// 模板后缀,选用的模板引擎
app.engine("art",require("express-art-template"))
// 设置模板存放地址
app.set("views","templates")
// 设置模板默认后缀
app.set("view engine","art")
app.get("/",(req,res)=>{
res.render("index",{data:"data"})
})
app.listen(80)