Merge pull request #1979 from thelounge/astorije/index
Do not statically serve the index template prior to rendering it
This commit is contained in:
commit
dcdc1d150f
@ -11,6 +11,7 @@
|
|||||||
client/**
|
client/**
|
||||||
!client/js/libs/handlebars/ircmessageparser/findLinks.js
|
!client/js/libs/handlebars/ircmessageparser/findLinks.js
|
||||||
!client/js/libs/handlebars/ircmessageparser/cleanIrcMessage.js
|
!client/js/libs/handlebars/ircmessageparser/cleanIrcMessage.js
|
||||||
|
!client/index.html.tpl
|
||||||
|
|
||||||
public/js/bundle.vendor.js.map
|
public/js/bundle.vendor.js.map
|
||||||
coverage/
|
coverage/
|
||||||
|
@ -251,7 +251,7 @@ function index(req, res, next) {
|
|||||||
res.setHeader("Content-Security-Policy", policies.join("; "));
|
res.setHeader("Content-Security-Policy", policies.join("; "));
|
||||||
res.setHeader("Referrer-Policy", "no-referrer");
|
res.setHeader("Referrer-Policy", "no-referrer");
|
||||||
|
|
||||||
return fs.readFile(path.join(__dirname, "..", "public", "index.html"), "utf-8", (err, file) => {
|
return fs.readFile(path.join(__dirname, "..", "client", "index.html.tpl"), "utf-8", (err, file) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,9 @@ describe("public folder", function() {
|
|||||||
expect(fs.existsSync(path.join(publicFolder, "fonts", "fontawesome-webfont.woff2"))).to.be.true;
|
expect(fs.existsSync(path.join(publicFolder, "fonts", "fontawesome-webfont.woff2"))).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("index.html is copied", function() {
|
it("index HTML file is not copied", function() {
|
||||||
expect(fs.existsSync(path.join(publicFolder, "index.html"))).to.be.true;
|
expect(fs.existsSync(path.join(publicFolder, "index.html"))).to.be.false;
|
||||||
|
expect(fs.existsSync(path.join(publicFolder, "index.html.tpl"))).to.be.false;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("javascript files are built", function() {
|
it("javascript files are built", function() {
|
||||||
|
@ -70,9 +70,10 @@ const config = {
|
|||||||
from: "./client/js/loading-error-handlers.js",
|
from: "./client/js/loading-error-handlers.js",
|
||||||
to: "js/[name].[ext]",
|
to: "js/[name].[ext]",
|
||||||
},
|
},
|
||||||
{ // TODO: Build index.html with handlebars
|
{
|
||||||
from: "./client/*",
|
from: "./client/*",
|
||||||
to: "[name].[ext]",
|
to: "[name].[ext]",
|
||||||
|
ignore: "index.html.tpl",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: "./client/audio/*",
|
from: "./client/audio/*",
|
||||||
|
Loading…
Reference in New Issue
Block a user