Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ejs

/*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!'));
Source by ejs.co #
 
PREVIOUS NEXT
Tagged: #ejs
ADD COMMENT
Topic
Name
1+7 =