本文共 313 字,大约阅读时间需要 1 分钟。
node ejs体验以及query数据
ejs体验,安装npm i ejs -S 然后引入,再进行使用,配置ejs后缀名文件为html,使用如下语句,否则还要改后缀名const ejs = require("ejs")//如果想改ejs为htmlapp.engine("html", ejs.__express);app.set('view engine', 'html');app.get("/", (req, res) => { res.render('index.html', { })})
前台form表单get请求,发送数据在地址栏,所以在后端使用req.query接收数据
1,页面转载地址:http://vjgwz.baihongyu.com/