Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Val Town API: unauthenticated eval

This val runs a val by using the Val Town API and returns the result of its evaluation.

1
2
3
4
5
6
7
8
9
import { fetch } from "https://esm.town/v/std/fetch";
export let evaluationFromValExample = (async () => {
const response = await fetch(`https://api.val.town/v1/eval`, {
method: "post",
body: JSON.stringify({ code: "1 + 1" }),
});
return await response.json();
})();
October 23, 2023