express中使用ejs注意点
作者:互联网
- 将后缀.ejs改成.html
app.engine('.html',require('ejs').__express);
app.set('view engine', 'html');
- 安装第三方中间件
body-parser
获取post表单传来的数据
// 配置第三方中间件 获取post提交的数据
const bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
标签:body,app,express,中间件,html,bodyParser,注意,ejs 来源: https://www.cnblogs.com/bitlei/p/14398018.html