fixed layout path
This commit is contained in:
parent
f760346265
commit
67b5887ba5
4 changed files with 13 additions and 12 deletions
11
index.js
11
index.js
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue