I'm trying to load a Mustache partial in express.js, but obviously I'm having a bit of trouble. Is it possible to to take a EJS approach like this where a view partial file is included:
Node.js - EJS - including a partial
I have a template file called index.html
<html>
<head>
<title>My Title</title>
</head>
<body>
{{>header}}
</body>
</html>
and header.mustache
<div class="header">
<div style="display: table-cell;padding-left: 10px;padding-top: 8px;vertical-align: middle;">
<img src="images/logo.png">
</div>
</div>
In express.js, my render function is something like this:
app.get('/', function(req, res) {
res.render('signup.html', {
partials: {
header: partial('header.mustache') //this line is wrong
}
});
});
I'm a newbie at this, but would like to somehow render or read the entire contents of header.mustache to the header object. Is this possible?