var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var ejs = require('ejs');
app.engine('ejs', ejs.renderFile);
app.use(bodyParser.urlencoded({
extended:true
}));
app.get('/', (req, res) => {
console.log('--get req--');
console.log('name:' + req.query.name);
console.log('age:' + req.query.age);
res.render('temp.ejs', {});
});
app.post('/', (req, res) => {
console.log('--post req--');
console.log('name:' + req.body.name);
console.log('age:' + req.body.age);
res.render('temp.ejs', {});
});
var server = app.listen(1234, () => console.log('wakeUp'));