aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordax <me@dax.ist>2026-08-04 07:13:58 +0000
committerdax <me@dax.ist>2026-08-04 07:13:58 +0000
commit08fa2e1bee4e0bae417cfda508212e011eccf631 (patch)
tree34267ff31c403796f61c73f6b0812c7e5213f184
parenta32e5b41b785e7334af6f796adc6a1b5216a5cc9 (diff)
pathways: fix deployment (files now land in public/), cache-bust assets + no-cache html, stronger zoom gesture (0.04/tile)
-rw-r--r--public/app.js2
-rw-r--r--public/index.html4
-rw-r--r--server.mjs4
3 files changed, 6 insertions, 4 deletions
diff --git a/public/app.js b/public/app.js
index 1a8118b..b8aeb68 100644
--- a/public/app.js
+++ b/public/app.js
@@ -43,7 +43,7 @@ function tileH(info) {
function worldScale() {
const n = tiles.size
if (n <= 1) return 1
- return Math.max(0.5, 1 - (n - 1) * 0.03)
+ return Math.max(0.5, 1 - (n - 1) * 0.04)
}
function applyPan() {
diff --git a/public/index.html b/public/index.html
index d30ce09..fd89634 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<title>pathways</title>
- <link rel="stylesheet" href="/app.css">
+ <link rel="stylesheet" href="/app.css?v=3">
</head>
<body>
<main id="stage">
@@ -16,6 +16,6 @@
<p>four paths, one per direction. walk them.</p>
<button id="start">start</button>
</div>
- <script src="/app.js"></script>
+ <script src="/app.js?v=3"></script>
</body>
</html>
diff --git a/server.mjs b/server.mjs
index 3c10134..6659426 100644
--- a/server.mjs
+++ b/server.mjs
@@ -157,7 +157,9 @@ function serveFile(res, path) {
res.writeHead(404).end("not found")
return
}
- res.writeHead(200, { "Content-Type": MIME[extname(path)] || "application/octet-stream", "Cache-Control": "max-age=300" })
+ const type = MIME[extname(path)] || "application/octet-stream"
+ const cache = path.endsWith(".html") ? "no-cache" : "max-age=300"
+ res.writeHead(200, { "Content-Type": type, "Cache-Control": cache })
createReadStream(path).pipe(res)
}