Skip to content

ecrmnn/express-edge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-edge

Use Edge templating engine with Express

Build Status npm version npm version npm downloads npm license prs Welcome eslint

Installation

npm install express-edge --save

Usage

See the Edge documentation for how to structure your templates.

Requires Node.js 14+ from express-edge@3

const express = require('express');
const app = express();
const engine = require('express-edge');

// Automatically sets view engine and adds dot notation to app.render
app.use(engine);
app.set('views', `${__dirname}/views`);

// Configure view caching
app.enable('view cache');
// --- or ---
app.diable('view cache');

app.get('/', (req, res) => {
  res.render('users.index', { users });
});

app.listen(3000);

License

MIT © Daniel Eckermann