render.javascript
v0.1.3
Published
Render.js | Template Engine for Express
Downloads
3
Readme
Getting Started
index.js
const RenderJS = require('render.javascript');
const express = require('express');
const app = express();
app.engine('rjs', RenderJS.renderFile);
app.set('view engine', 'rjs');
app.get('/', (req, res) => {
res.render('index', {
date: new Date().toLocaleDateString()
});
});
app.listen(3000, () => {
console.log('Server listening at ::3000 port');
});
index.rjs
<html>
<body>
Today: {{ date }}
</body>
</html>