Skip to content

Commit 5c62ed8

Browse files
committed
Support remote access
1 parent 1a51088 commit 5c62ed8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

graphing/arc/arc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://observablehq.com/@d3/arc-diagram@265
22
export default function define(runtime, observer) {
33
const main = runtime.module();
4-
const fileAttachments = new Map([["arcData.json", new URL("http://localhost:3000/arcAPI", import.meta.url)]]);
4+
const fileAttachments = new Map([["arcData.json", new URL(`${window.location.origin}/arcAPI`, import.meta.url)]]);
55
main.builtin("FileAttachment", runtime.fileAttachments(name => fileAttachments.get(name)));
66
main.variable(observer()).define(["md"], function (md) {
77
return (

graphing/cascade/graph.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function define(runtime, observer) {
88
const urlParams = new URLSearchParams(queryString);
99
const startFunction = urlParams.get('start')
1010

11-
fetch('http://localhost:3000/cascadeAPI/' + startFunction)
11+
fetch(`${window.location.origin}/cascadeAPI/` + startFunction)
1212
.then((response) => {
1313
return response.json();
1414
})

graphing/cascade/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
<script>
105105

106-
fetch('http://localhost:3000/all')
106+
fetch(`${window.location.origin}/all`)
107107
.then((response) => {
108108
return response.json();
109109
})

graphing/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h2>
5555

5656
<script>
5757

58-
fetch('http://localhost:3000/all')
58+
fetch(`${window.location.origin}/all`)
5959
.then((response) => {
6060
return response.json();
6161
})

0 commit comments

Comments
 (0)