📅  最后修改于: 2022-03-11 15:04:08.893000             🧑  作者: Mango
/*EJS with express
In Express v4, a very basic setup using EJS would look like the following.
(This assumes a views directory containing an index.ejs page.) */
let express = require('express');
let app = express();
//to set view engine for using EJS
app.set('view engine', 'ejs');
app.get('/', (req, res) => {
res.render('index', {foo: 'FOO'});
});
app.listen(4000, () => console.log('Example app listening on port 4000!'));