mirror of
https://github.com/aljazceru/satshkd-vercel.git
synced 2025-12-17 13:14:25 +01:00
testing hbs extension
This commit is contained in:
9
index.js
9
index.js
@@ -17,11 +17,11 @@ const zhcnjson = require('./locales/zh-cn.json');
|
|||||||
const zhhkjson = require('./locales/zh-hk.json');
|
const zhhkjson = require('./locales/zh-hk.json');
|
||||||
const enjson = require('./locales/en.json');
|
const enjson = require('./locales/en.json');
|
||||||
|
|
||||||
app.set('view engine', 'html');
|
app.set('view engine', 'hbs');
|
||||||
|
|
||||||
app.engine('html', handlebars({
|
app.engine('hbs', handlebars({
|
||||||
layoutsDir: __dirname + '/views/layouts',
|
layoutsDir: __dirname + '/views/layouts',
|
||||||
extname: 'html',
|
extname: 'hbs',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//Serves static files (we need it to import a css file)
|
//Serves static files (we need it to import a css file)
|
||||||
@@ -55,7 +55,8 @@ app.use(express.static(path.join(__dirname, 'public', 'css')));
|
|||||||
app.use(express.json({ extended: false }));
|
app.use(express.json({ extended: false }));
|
||||||
|
|
||||||
app.get('/', function(req, res) {
|
app.get('/', function(req, res) {
|
||||||
res.redirect('/en');
|
res.render('test', enjson)
|
||||||
|
// res.redirect('/en');
|
||||||
//res.render('index', { layout: 'main' });
|
//res.render('index', { layout: 'main' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user