Skip to navigation

runCode

Referenced In

Fields

FieldTypeDescriptionDefault
runCodeobject(Run code (detailed))Required. Assemble and run code.—

Examples

{
"runCode": {
"language": "javascript",
"code": "console.log('Hello, ${process.env.USER}!');"
}
}
{
"runCode": {
"language": "bash",
"code": "docker run hello-world",
"timeout": 20000,
"exitCodes": [
0
],
"stdio": "Hello from Docker!"
}
}
{
"runCode": {
"language": "javascript",
"code": "return false",
"exitCodes": [
1
]
}
}
{
"runCode": {
"language": "python",
"code": "print('Hello from Python')",
"workingDirectory": ".",
"exitCodes": [
0
],
"stdio": "Hello from Python!",
"path": "python-output.txt",
"directory": "output",
"maxVariation": 0.1,
"overwrite": "aboveVariation"
}
}
{
"runCode": {
"language": "javascript",
"code": "require('http').createServer((req, res) => res.end('ok')).listen(8088);",
"background": {
"name": "api",
"waitUntil": {
"port": 8088
}
},
"timeout": 15000
}
}