📌  相关文章
📜  如何将变量从 js 传递到 html 节点 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:59.335000             🧑  作者: Mango

代码示例1
var bodyParser = require('body-parser');
var express = require('express');
var app = express();

app.use(express.static(__dirname + '/'));
app.use(bodyParser.urlencoded({extend:true}));
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.set('views', __dirname);

app.get('/', function(req, res){
    res.render('index.html',{email:data.email,password:data.password});
});