API ReferenceExecute
Execute Code
Send a TypeScript or JavaScript module, get the result
Request Body
application/json
script*string
The JavaScript or TypeScript script to execute
config?
Response Body
application/json
application/json
application/json
curl -X POST "https://api.freestyle.sh/execute/v1/script" \ -H "Content-Type: application/json" \ -d '{ "script": "export default () => {\n // get the value of the factorials of the numbers from 1 to 10 combined\n const a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n - 1);\n }\n\n const b = a.map(factorial);\n\n return b.reduce((a, b) => a + b);\n};\n" }'{
"result": null,
"logs": [
{
"message": "I'm a log!",
"type": "log"
}
]
}{
"error": "string",
"logs": [
{
"message": "I'm a log!",
"type": "log"
}
]
}{
"error": "string",
"logs": [
{
"message": "I'm a log!",
"type": "log"
}
]
}Provision a wildcard certificate
Provisions a wildcard certificate for a verified domain This speeds up deploys on all subdomains of the domain. In order to use it, you must add the following record to your DNS config: `_acme-challenge.yourdomain.com` NS `dns.freestyle.sh`
Get information on execute run
Get information on execute run