I created a basic Node.js webserver with this code:
'use strict';
var express = require('express');
var app = express();
var server = app.listen(1337, '127.0.0.1', function () {
//app.use(express.static(__dirname + '/public'));
app.use(express.static(__dirname + '/'));
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
I have a basic HTML5 Boilerplate. What I want in the future is to have a separated HTML file for navigation, which will only contain this:
<nav>
<ul>
<li>menu item</li>
<li>menu item</li>
<li>menu item</li>
</ul>
</nav>
And this HTML file, for example 'nav.html" will embedded in the right place of my document. I done this in the past with PHP's require_once (if I remember well). I want to separate my site's header, content, footer, navigation in different document's, because if I changing the menu (adding, deleting pages), I don't need to re-edit every single page. So I want something similar to do a static site with Node.js. I'm installed Express and Handlebars.
Is it possible somehow?
I hate Jade, that's why I don't want to use it. I just don't like when I don't see my final code in the editor.