updated readme

This commit is contained in:
Brian Seymour 2021-04-22 21:30:01 -05:00
parent 09983a5fa5
commit 04990566a1
4 changed files with 51 additions and 36 deletions

View File

@ -64,7 +64,7 @@ const app = express();
if (!errors.isEmpty()) {
return res
.status(422)
.status(400)
.send({
message: errors.array()
});

View File

@ -1,9 +1,14 @@
<h1 align="center">
<a href="https://github.com/engineer-man/piston"><img src="var/docs/images/icon_circle.svg" width="25" height="25" alt="engineer-man piston"></a>
Piston
<a href="https://github.com/engineer-man/piston">
<img src="var/docs/images/piston.svg" width="32" height="32" style="vertical-align: middle;" alt="engineer-man piston" />
</a>
<span>
Piston
</span>
</h1>
<h3 align="center">A high performance general purpose code execution engine.</h3>
<br>
<p align="center">
@ -37,22 +42,29 @@
# About
<h4>
Piston is a high performance general purpose code execution engine. It excels at running untrusted and
possibly malicious code without fear from any harmful effects.
Piston is a high performance general purpose code execution engine. It excels at running untrusted and
possibly malicious code without fear from any harmful effects.
</h4>
<br>
It's used in numerous places including:
* [EMKC Challenges](https://emkc.org/challenges),
* [EMKC Weekly Contests](https://emkc.org/contests),
* [Engineer Man Discord Server](https://discord.gg/engineerman),
* [I Run Code (Discord Bot)](https://github.com/engineer-man/piston-bot) bot as well as 1300+ other servers
and 100+ direct integrations.
* [EMKC Challenges](https://emkc.org/challenges)
* [EMKC Weekly Contests](https://emkc.org/contests)
* [Engineer Man Discord Server](https://discord.gg/engineerman)
* [I Run Code (Discord Bot)](https://github.com/engineer-man/piston-bot) bot as well as 4000+ other servers
and 200+ direct integrations.
To get it in your own server, go here: https://emkc.org/run.
<br>
### Official Extensions
The following are approved and endorsed extensions/utilities to the core Piston offering.
- [Piston CLI](https://github.com/Shivansh-007/piston-cli), a universal shell supporting code highlighting, files, and interpretation without the need to download a language.
<br>
# Public API
- Requires no installation and you can use it immediately.
@ -171,21 +183,21 @@ HTTP/1.1 200 OK
Content-Type: application/json
[
{
"language": "bash",
"version": "5.1.0",
"aliases": [
"sh"
]
},
{
"language": "brainfuck",
"version": "2.7.3",
"aliases": [
"bf"
]
},
...
{
"language": "bash",
"version": "5.1.0",
"aliases": [
"sh"
]
},
{
"language": "brainfuck",
"version": "2.7.3",
"aliases": [
"bf"
]
},
...
]
```
@ -197,17 +209,18 @@ This endpoint requests execution of some arbitrary code.
- `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file.
- `files[].name` (**optinal**) The name of the file to upload, must be a string containing no path.
- `files[].content` (**required**) The content of the files to upload, must be a string containing text to write.
- `stdin` (**optional**) The text to pass as stdin to the program. Must be a string, can be left blank.
- `args` (**optional**) The arguments to pass to the program. Must be an array.
- `compile_timeout` (**optional**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number.
- `run_timeout` (**optional**) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number.
- `stdin` (*optional*) The text to pass as stdin to the program. Must be a string, can be left blank.
- `args` (*optional*) The arguments to pass to the program. Must be an array.
- `compile_timeout` (*optional*) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number.
- `run_timeout` (*optional*) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number.
```json
{
"language": "js",
"version": "15.10.0",
"files":[
"files": [
{
"main": true,
"name": "my_cool_code.js",
"content": "console.log(process.argv)"
}
@ -232,14 +245,15 @@ HTTP/1.1 200 OK
Content-Type: application/json
{
"run": {
"stdout": "[\n '/piston/packages/node/15.10.0/bin/node',\n '/piston/jobs/9501b09d-0105-496b-b61a-e5148cf66384/my_cool_code.js',\n '1',\n '2',\n '3'\n]\n",
"stderr": "",
"code": 0,
"signal": null
}
"run": {
"stdout": "[\n '/piston/packages/node/15.10.0/bin/node',\n '/piston/jobs/9501b09d-0105-496b-b61a-e5148cf66384/my_cool_code.js',\n '1',\n '2',\n '3'\n]\n",
"stderr": "",
"code": 0,
"signal": null
}
}
```
If a problem exists with the request, a `400` status code is returned and the reason in the `message` key.
```json
HTTP/1.1 400 Bad Request

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><defs><style>.cls-1{fill:#131424;}.cls-2{fill:url(#linear-gradient);}</style><linearGradient id="linear-gradient" x1="313.84" y1="162.5" x2="158.19" y2="318.15" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#53c7e5"/><stop offset="0.5" stop-color="#1ea4dd"/><stop offset="1" stop-color="#167ec1"/></linearGradient></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_4" data-name="Layer 4"><rect class="cls-1" width="512" height="512"/><path class="cls-2" d="M227.17,255.54V371.65l-44.95-29.47V281.23Zm30.38,47.15,98.23-51.21v-47l-128.19-64.1L182.22,163.2v55.13l45.37-25.54,69.09,35.38-39,17.08Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 734 B