Last active
October 3, 2022 08:10
-
-
Save irik77587/2178d448e4d6fb6962791b1fd38ab56a to your computer and use it in GitHub Desktop.
treat html file as handlebars in express
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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