I am assuming that test.html is a static file. To render static files, use the static middleware like so:
app.use(express.static(path.join(__dirname, 'public')));
This tells Express to look for static files in the public directory of the application.
Once you have specified this, simply point your browser to the location of the file and it should display.
If, however, you want to render the views, then you have to use the appropriate renderer for it. The list of renderers is defined in the consolidate.js library.
Once you have decided which library to use just install it. I use mustache so here is a snippet of my app file:
var engines = require('consolidate');
app.set('views', __dirname + '/views');
app.engine('html', engines.mustache);
app.set('view engine', 'html');
This tells Express to—
- Look for files to render in the
viewsdirectory - Render the files using
mustache - The extension of the file is
.html(you can use.mustachetoo).