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 express = require('express');
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
const expressHandlebars = require('express-handlebars');
|
const expressHandlebars = require('express-handlebars');
|
||||||
const Handlebars = require('handlebars');
|
|
||||||
const helmet = require('helmet');
|
const helmet = require('helmet');
|
||||||
const cookieSession = require('cookie-session');
|
const cookieSession = require('cookie-session');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
@ -81,11 +80,13 @@ function Server () {
|
||||||
app.use(speechPassport.session());
|
app.use(speechPassport.session());
|
||||||
|
|
||||||
// configure handlebars & register it with express app
|
// 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',
|
defaultLayout: 'embed',
|
||||||
handlebars : Handlebars,
|
partialsDir: Path.join(viewsPath, '/partials'),
|
||||||
});
|
layoutsDir: Path.join(viewsPath, '/layouts')
|
||||||
app.engine('handlebars', hbs.engine);
|
}));
|
||||||
|
app.set('views', viewsPath);
|
||||||
app.set('view engine', 'handlebars');
|
app.set('view engine', 'handlebars');
|
||||||
|
|
||||||
// set the routes on the app
|
// set the routes on the app
|
||||||
|
|
|
@ -4,7 +4,7 @@ const sendVideoEmbedPage = ({ params }, res) => {
|
||||||
const claimId = params.claimId;
|
const claimId = params.claimId;
|
||||||
const name = params.name;
|
const name = params.name;
|
||||||
// get and render the content
|
// 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;
|
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">
|
<body id="embed-video-player">
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
video {
|
video {
|
||||||
width:100%;
|
width:100%;
|
||||||
max-width:600px;
|
max-width:600px;
|
||||||
height:auto;
|
height:auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{{{body}}}
|
{{{body}}}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue