A deno api for running code in different programming languages.
Clone the project
git clone https://github.com/thieves-guild/code-runner-api.git
Go to the project directory
cd code-runner-api
Start the server
# locally production
deno task start
# locally development
deno task dev
# container
docker-compose up --build
You can use Bruno to open code-runner-api folder (collection).
GET /health
HTTP/1.1 200 OK
GET /languages
HTTP/1.1 200 OK
Content-Type: application/json
{
"languages": [
{
"name": "typescript",
"info": {
"enviromentCommand": "--version",
"executionCommand": "deno",
"executionArgs": [
"run"
],
"extension": "ts",
"websiteUrl": "https://www.typescriptlang.org/"
},
"enviroment": [
"deno 1.37.0 (release, x86_64-unknown-linux-gnu)",
"v8 11.8.172.3",
"typescript 5.2.2"
]
},
{
"name": "python3",
"info": {
"enviromentCommand": "--version",
"executionCommand": "python3",
"executionArgs": [],
"extension": "py",
"websiteUrl": "https://www.python.org/"
},
"enviroment": [
"Python 3.10.13"
]
}
],
"timeStampt": 1695563685183
}
GET /languages/:languageName
HTTP/1.1 200 OK
Content-Type: application/json
{
"name": "python3",
"info": {
"enviromentCommand": "--version",
"executionCommand": "python3",
"executionArgs": [],
"extension": "py",
"websiteUrl": "https://www.python.org/"
},
"enviroment": [
"Python 3.10.13"
],
"timeStampt": 1695563724530
}
POST /code
Content-Type: application/json
{
"language": "typescript",
"code": "console.log('hello world');"
}
HTTP/1.1 201 OK
Content-Type: application/json
{
"languague": "typescript",
"code": 0,
"stdout": "hello world\n",
"stderr": "",
"timeStampt": 1695563805981
}