how to pass variables from js to html node

Solutions on MaxInterview for how to pass variables from js to html node by the best coders in the world

showing results for - "how to pass variables from js to html node"
Monica
28 Jan 2018
1var bodyParser = require('body-parser');
2var express = require('express');
3var app = express();
4
5app.use(express.static(__dirname + '/'));
6app.use(bodyParser.urlencoded({extend:true}));
7app.engine('html', require('ejs').renderFile);
8app.set('view engine', 'html');
9app.set('views', __dirname);
10
11app.get('/', function(req, res){
12    res.render('index.html',{email:data.email,password:data.password});
13});