Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%- include myview.ejs %>
- var path = require('path');
- // Set the default templating engine to ejs
- app.set('view engine', 'ejs');
- app.set('views', path.join(__dirname, 'views'));
- // The views/index.ejs exists in the app directory
- app.get('/hello', function (req, res) {
- res.render('index', {title: 'title'});
- });
- <%- include partials/navigation.ejs %>
- <ul><li class="active">...</li>...</ul>
- var path = require('path');
- var EJS = require('ejs');
- app.engine('html', EJS.renderFile);
- // Set the default templating engine to ejs
- app.set('view engine', 'ejs');
- app.set('views', path.join(__dirname, 'views'));
- // The views/index.html exists in the app directory
- app.get('/hello', function (req, res) {
- res.render('index.html', {title: 'title'});
- });
- var EJSLayout = require('express-ejs-layouts');
- app.use(EJSLayout);
- // above is all your node requires
- // view engine setup
- app.set('views', path.join(__dirname, 'views')); <-- ./views has all your .ejs files
- app.set('view engine', 'ejs');
- <!-- because ejs knows your root directory for views, you can navigate to the ./base directory and select the header.ejs file and include it -->
- <% include ./base/header %>
- <h1> Other mark up here </h1>
- <% include ./base/footer %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement