Skip to content

Instantly share code, notes, and snippets.

@irik77587
Last active October 3, 2022 08:10
Show Gist options
  • Save irik77587/2178d448e4d6fb6962791b1fd38ab56a to your computer and use it in GitHub Desktop.
Save irik77587/2178d448e4d6fb6962791b1fd38ab56a to your computer and use it in GitHub Desktop.
treat html file as handlebars in express
var express = require('express');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
// app.set('view engine', 'hbs');
// To use a different extension (i.e. html) for your template files:
app.set('view engine', 'html');
app.engine('html', require('hbs').__express);
app.listen(8000, console.log('Serving at http://localhost:8000'))
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment