Fix styles.css cache-busting so CSS updates always reach the browser
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "site-gateway",
|
"name": "site-gateway",
|
||||||
"version": "0.11.41",
|
"version": "0.11.42",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.",
|
"description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<title>Site Gateway</title>
|
<title>Site Gateway</title>
|
||||||
<meta name="description" content="Host sites, proxy services, and manage HTTPS from one simple dashboard.">
|
<meta name="description" content="Host sites, proxy services, and manage HTTPS from one simple dashboard.">
|
||||||
<link rel="icon" type="image/png" href="/site-gateway-icon-approved.png">
|
<link rel="icon" type="image/png" href="/site-gateway-icon-approved.png">
|
||||||
<link rel="stylesheet" href="/styles.css">
|
<link rel="stylesheet" href="/styles.css?v=0.11.28">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="login" class="login-shell hidden">
|
<div id="login" class="login-shell hidden">
|
||||||
|
|||||||
+2
-1
@@ -1014,7 +1014,8 @@ app.use(express.json());
|
|||||||
app.use(express.urlencoded({ extended: false }));
|
app.use(express.urlencoded({ extended: false }));
|
||||||
app.get(["/", "/index.html"], (req, res) => {
|
app.get(["/", "/index.html"], (req, res) => {
|
||||||
const html = fs.readFileSync(path.join(publicDir, "index.html"), "utf8")
|
const html = fs.readFileSync(path.join(publicDir, "index.html"), "utf8")
|
||||||
.replace(/\/(app|features)\.js\?v=[^"']+/g, `/$1.js?v=${appVersion}`);
|
.replace(/\/(app|features)\.js\?v=[^"']+/g, `/$1.js?v=${appVersion}`)
|
||||||
|
.replace(/\/styles\.css\?v=[^"']+/g, `/styles.css?v=${appVersion}`);
|
||||||
res.type("html").send(html);
|
res.type("html").send(html);
|
||||||
});
|
});
|
||||||
app.use(express.static(publicDir));
|
app.use(express.static(publicDir));
|
||||||
|
|||||||
Reference in New Issue
Block a user