-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (30 loc) · 867 Bytes
/
Copy pathindex.html
File metadata and controls
32 lines (30 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<title>Test of the REST API services module</title>
</head>
<body>
<h1>Test script</h1>
<script type="module">
import {API_REST, HTTP_GET} from "./lib/API.js";
window.api = new API_REST();
api.define_endpoint(
"slow_response",
(d) => {
console.log("First Handler:");
console.log(d);
}
).define_endpoint(
"slow_response",
(d) => {
console.log("Second Handler:");
console.log(d);
}
);
console.log("First call to back-end");
console.log(api.call("slow_response", HTTP_GET));
console.log("Second call to back-end");
console.log(api.call("slow_response", HTTP_GET));
</script>
</body>
</html>