API 設計
Opened this issue · 1 comments
Tamrin007 commented
ブラウザからプログラミング言語とコードを受け取る
Tamrin007 commented
[GET] /
ルームに入る
index.html
を返す
[GET] /:roomName
以前のルームに入る
- Response
{
"language": "ruby",
"code": "p 'Hello, world'"
}
[POST] /exec
ユーザのコードを実行する
- Paramaters
{
"language": "ruby",
"code": "p 'Hello, world'"
}
- Response
{
"is_error": false,
"run_time": "0,04ms",
"output": "Hello, world"
}
[POST] /search
- Paramaters
{
"language": "js",
"code":"consolelog(\"a\")",
"output":"/workspace/script.js:1\n(function (exports, require, module, __filename, __dirname) { consolelog(\"a\")\n ^\n\nReferenceError: consolelog is not defined\n at Object.\u003canonymous\u003e (/workspace/script.js:1:63)\n at Module._compile (module.js:570:32)\n at Object.Module._extensions..js (module.js:579:10)\n at Module.load (module.js:487:32)\n at tryModuleLoad (module.js:446:12)\n at Function.Module._load (module.js:438:3)\n at Module.runMain (module.js:604:10)\n at run (bootstrap_node.js:394:7)\n at startup (bootstrap_node.js:149:9)\n at bootstrap_node.js:509:3\n"
}
- Response
{
"title":"JavaScript | MDN",
"url":"https://developer.mozilla.org/ja/docs/Web/JavaScript"
}