runValAPI
Script
v4
Fork
1
2
3
4
5
6
7
8
export
function
runValAPI
(
name
,
...
args
)
{
return
fetch
(
`https://api.val.town/v1/run/
${
name
.
replace
(
"@"
,
""
)
}
`
,
{
method
:
"POST"
,
body
:
JSON
.
stringify
(
{
args
,
}
)
,
}
)
.
then
(
(
r
)
=>
r
.
json
(
)
)
;
}