fixed layout path

This commit is contained in:
bill bittner 2018-07-02 18:22:06 -07:00
parent f760346265
commit 67b5887ba5
4 changed files with 13 additions and 12 deletions

View file

@ -16,7 +16,6 @@ checkForConfig('siteConfig');
const express = require('express');
const bodyParser = require('body-parser');
const expressHandlebars = require('express-handlebars');
const Handlebars = require('handlebars');
const helmet = require('helmet');
const cookieSession = require('cookie-session');
const http = require('http');
@ -81,11 +80,13 @@ function Server () {
app.use(speechPassport.session());
// configure handlebars & register it with express app
const hbs = expressHandlebars.create({
const viewsPath = Path.resolve(process.cwd(), 'node_modules/spee.ch/server/views');
app.engine('handlebars', expressHandlebars({
defaultLayout: 'embed',
handlebars : Handlebars,
});
app.engine('handlebars', hbs.engine);
partialsDir: Path.join(viewsPath, '/partials'),
layoutsDir: Path.join(viewsPath, '/layouts')
}));
app.set('views', viewsPath);
app.set('view engine', 'handlebars');
// set the routes on the app

View file

@ -4,7 +4,7 @@ const sendVideoEmbedPage = ({ params }, res) => {
const claimId = params.claimId;
const name = params.name;
// get and render the content
res.status(200).render('embed', { layout: 'embed', host, claimId, name });
res.status(200).render('embed', { host, claimId, name });
};
module.exports = sendVideoEmbedPage;

View file

@ -1 +1 @@
<video width="100%" controls src="{{host}}/{{claimId}}/{{name}}.mp4" type="video/mp4"></video>
<video width="100%" controls src="{{host}}/asset/{{name}}/{{claimId}}" type="video/mp4"></video>

View file

@ -3,14 +3,14 @@
<body id="embed-video-player">
<style type="text/css">
video {
width:100%;
max-width:600px;
height:auto;
video {
width:100%;
max-width:600px;
height:auto;
}
</style>
{{{body}}}
</body>
</html>
</html>