Skip to content

Commit 5a8a738

Browse files
authored
Fix routing in ws-sse example server (#121)
* Fix selected attribute in ws-sse example * Fix routing in ws-sse example
1 parent 35fad14 commit 5a8a738

File tree

10 files changed

+11
-39
lines changed

10 files changed

+11
-39
lines changed

test/ws-sse/static/site-base.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
<a href="/">Introduction</a>
1515

1616
<div class="group">
17-
<a href="/ws-about-ext.html">WebSockets</a>
18-
<a href="/ws-echo-ext.html">Echo</a>
19-
<a href="/ws-heartbeat-ext.html">Heartbeat</a>
17+
<a href="/ws-about.html">WebSockets</a>
18+
<a href="/ws-echo.html">Echo</a>
19+
<a href="/ws-heartbeat.html">Heartbeat</a>
2020
</div>
2121

2222
<div class="group">
23-
<a href="/sse-about-ext.html">Server Sent Events</a>
24-
<a href="/sse-simple-ext.html">Simple</a>
25-
<a href="/sse-multiple-ext.html">Multiple</a>
26-
<a href="/sse-multichannel-ext.html">Multi-Channel</a>
27-
<a href="/sse-triggers-ext.html">Event Trigger</a>
28-
<a href="/sse-target-ext.html">Event Target</a>
29-
<a href="/sse-settle-ext.html">Settling</a>
23+
<a href="/sse-about.html">Server Sent Events</a>
24+
<a href="/sse-simple.html">Simple</a>
25+
<a href="/sse-multiple.html">Multiple</a>
26+
<a href="/sse-multichannel.html">Multi-Channel</a>
27+
<a href="/sse-triggers.html">Event Trigger</a>
28+
<a href="/sse-target.html">Event Target</a>
29+
<a href="/sse-settle.html">Settling</a>
3030
</div>
3131
</div>
3232

@@ -35,7 +35,6 @@
3535
// Obviously you could do this with a template engine instead but I'm not using a template engine
3636
const navlinks = document.querySelectorAll("#navigation a");
3737
navlinks.forEach((link) => {
38-
const locWithoutExt = window.location.toString().replace("-ext", "");
39-
if (link.href === locWithoutExt) link.classList.add("selected");
38+
if (link.href === window.location.toString()) link.classList.add("selected");
4039
});
4140
</script>
File renamed without changes.

test/ws-sse/static/ws-reconnect-ext.html

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)