relax-express-hogan
v0.2.0
Published
Hogan.js for Express
Downloads
6
Maintainers
Readme
relax-express-hogan
Connect Hogan.js with Express, with support for Partials.
Why Hogan.js?
Hogan.js is a very straighforward implementation of mustache that keeps logic out of your views.
Usage Example
views/index.html
{{> header}} {{who}}
{{> footer}}
views/header.html
<i>Hey There</i>,
views/footer.html
<footer>See ya</footer>
app.js
import express from 'express'
import expressHogan from 'relax-express-hogan'
const app = express()
app.set('views', __dirname + '/views')
app.set('view engine', 'html')
app.register('html', expressHogan)
app.get('/', (req, res) => {
res.render('index', {
who: 'World'
})
})
app.listen(3000)
% node app.js
% curl http://localhost:3000
<i>Hey There</i>, World
<footer>See ya</footer>