Compare commits
4 Commits
24a2991292
...
2f7668efa7
Author | SHA1 | Date |
---|---|---|
Robbie Antenesse | 2f7668efa7 | |
Robbie Antenesse | 0ab8bbb6e4 | |
Robbie Antenesse | fd085cc820 | |
Robbie Antenesse | 86e6bcee61 |
|
@ -8,3 +8,4 @@ public/history/*.json
|
||||||
.well-known/
|
.well-known/
|
||||||
|
|
||||||
settings.json
|
settings.json
|
||||||
|
customHtmlAfterFooter.html
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
console.log('This runs after everything else is loaded.');
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "little-library",
|
"name": "little-library",
|
||||||
"version": "0.0.0",
|
"version": "0.1.0",
|
||||||
"description": "A digital give-a-book, take-a-book library for ebooks",
|
"description": "A digital give-a-book, take-a-book library for ebooks",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -30,7 +30,7 @@ module.exports = function (app) {
|
||||||
}),
|
}),
|
||||||
footer: '<a class="button close">Close</a>',
|
footer: '<a class="button close">Close</a>',
|
||||||
});
|
});
|
||||||
return app.templater.fill('./templates/elements/book.html', {
|
return app.templater.fill('./templates/elements/book_readable.html', {
|
||||||
id,
|
id,
|
||||||
title: bookData.title,
|
title: bookData.title,
|
||||||
author: bookData.author,
|
author: bookData.author,
|
||||||
|
|
|
@ -181,8 +181,8 @@ Server.prototype.start = function () {
|
||||||
console.log('Started server on port ' + (process.env.PORT || settings.port));
|
console.log('Started server on port ' + (process.env.PORT || settings.port));
|
||||||
});
|
});
|
||||||
if (this.https) {
|
if (this.https) {
|
||||||
this.https.listen(443, () => {
|
this.https.listen(settings.sslPort, () => {
|
||||||
console.log('Started SSL server on port 443');
|
console.log('Started SSL server on port ' + settings.sslPort);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
"allowedFormats": [".epub", ".mobi", ".pdf"],
|
"allowedFormats": [".epub", ".mobi", ".pdf"],
|
||||||
"toolsPassword": "password",
|
"toolsPassword": "password",
|
||||||
"hideVisitors": false,
|
"hideVisitors": false,
|
||||||
|
"sslPort": 443,
|
||||||
"sslPrivateKey": null,
|
"sslPrivateKey": null,
|
||||||
"sslCertificate": null,
|
"sslCertificate": null,
|
||||||
"sslCertificateAuthority": null,
|
"sslCertificateAuthority": null,
|
||||||
|
|
|
@ -26,6 +26,11 @@ module.exports = class {
|
||||||
.replace(/\{\{allowedFormats\}\}/g, settings.allowedFormats.join(','))
|
.replace(/\{\{allowedFormats\}\}/g, settings.allowedFormats.join(','))
|
||||||
.replace(/\{\{maxFileSize\}\}/g, (settings.maxFileSize > 0 ? settings.maxFileSize + 'MB' : 'no'));
|
.replace(/\{\{maxFileSize\}\}/g, (settings.maxFileSize > 0 ? settings.maxFileSize + 'MB' : 'no'));
|
||||||
|
|
||||||
|
if (fs.existsSync(path.resolve('./customHtmlAfterFooter.html'))) {
|
||||||
|
const customHtmlAfterFooter = fs.readFileSync(path.resolve('./customHtmlAfterFooter.html'));
|
||||||
|
filledTemplate = filledTemplate.replace(/\{\{customHtmlAfterFooter\}\}/g, customHtmlAfterFooter);
|
||||||
|
}
|
||||||
|
|
||||||
for (let templateVar in templateVars) {
|
for (let templateVar in templateVars) {
|
||||||
const regExp = new RegExp('\{\{' + templateVar + '\}\}', 'g')
|
const regExp = new RegExp('\{\{' + templateVar + '\}\}', 'g')
|
||||||
filledTemplate = filledTemplate.replace(regExp, templateVars[templateVar]);
|
filledTemplate = filledTemplate.replace(regExp, templateVars[templateVar]);
|
||||||
|
|
|
@ -86,6 +86,8 @@
|
||||||
|
|
||||||
{{modal}}
|
{{modal}}
|
||||||
<script src="{{resourcePath}}js/little-library.js"></script>
|
<script src="{{resourcePath}}js/little-library.js"></script>
|
||||||
|
|
||||||
|
{{customHtmlAfterFooter}}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue