1
2
3
4
5
6
7
8
9
10
11
import { fetch } from "https://esm.town/v/std/fetch";
import { API_URL } from "https://esm.town/v/std/API_URL";
export function runVal(name, ...args) {
return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
method: "POST",
body: JSON.stringify({
args,
}),
}).then((r) => r.json());
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
1
zarutian avatar

So, this no longer works due to deprication of the run api.

The irritating thing is that this val was to replace the api() calling method that came to be due to Restricted Library mode that took away the neat feature of lexically scoped "run as author" of val functions and the ability of passing such functions around as first class.

This kind of repeated breakage is getting rather annoying.

October 23, 2023