S
S
SpideR-KOSS2018-08-06 15:50:33
Node.js
SpideR-KOSS, 2018-08-06 15:50:33

Handlebars template not rendering?

Good afternoon!
It stopped, it stopped (before that it worked) the handlebars template for express is being rendered.
I rechecked all the settings, but it still loads the default template (main).
Here is the code:

var express = require('express');
var app = express();
var exphbs  = require('express-handlebars');
app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');

app.get('/auth', function (req, res) {
  res.render('auth');
});

There is an auth.handlebars file along the views path.
When navigating to /auth, the default template is rendered - main.handlebars.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question