Code Challenge by docker sandbox
Chú ý: source code này chỉ support cho hệ điều hành linux, mac os thôi nhé. window thì có vẻ không chạy (tại không có máy window để test)
cd docker
docker build -t ntcd_php -f php/Dockerfile .
docker run -it --rm -v /tmp:/tmp ntcd_php php /tmp/main.php /tmp/output
cd docker
docker build -t ntcd_javascript -f javascript/Dockerfile .
docker run -it --rm -v /tmp:/tmp ntcd_javascript node /tmp/main.js /tmp/output
npm run start
Endpoint: http://localhost:3000/run/:language
Request
{
"content": "<?php $a = 12; $b = $a * 2; echo $b;"
}
Response
{
"stdout": "24",
"error": "",
"time": ".0911\n"
}