Skip to content
JavaScript Dockerfile HTML Shell CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
docker
public/stylesheets
routes
views
README.md
app.js
package-lock.json
package.json

README.md

code-challenge

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)

Build image cho docker

PHP

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

Javascript

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

Start API

npm run start

API

Endpoint: http://localhost:3000/run/:language

Request

{
	"content": "<?php $a = 12; $b = $a * 2; echo $b;"
}

Response

{
  "stdout": "24",
  "error": "",
  "time": ".0911\n"
}
You can’t perform that action at this time.