v0.1.2 - 2021 by Jeremy Carter <[email protected]>
GitLab: https://gitlab.com/defcronyke/rust-playground-api
GitHub: https://github.com/defcronyke/rust-playground-api
Run some Rust code online. Get the program's output, as well as assembly and WebAssembly, as a JSON response.
Example:
https://tinyurl.com/rust-playground-api?id=1ea016619193533f9ac6cd1d8ae22d58
https://tinyurl.com/rust-playground-api-run?id=1ea016619193533f9ac6cd1d8ae22d58
https://tinyurl.com/rust-playground-api-wasm?id=1ea016619193533f9ac6cd1d8ae22d58
https://tinyurl.com/rust-playground-api-asm?id=1ea016619193533f9ac6cd1d8ae22d58
NOTE: After downloading and extracting from the GitHub mirror, you need to run the following commands because GitHub Actions isn't preserving the correct permissions for the files:
cd rust-playground-api && chmod 755 *
git clone https://github.com/defcronyke/rust-playground-api.git && \
cd rust-playground-api
-
Automated build version:
./rust-playground-api
-
Git source version:
./serve.sh
-
Make a GitHub
secret
orpublic
Gist, with your desiredRust
program code in it:
https://gist.github.com -
Get the Gist's ID from its URL, for example the
id
value as below:
https://gist.github.com/{username}/{id} -
Run the
Rust
code by using theid
in your GET request, for example:
http://localhost:8080/?id=1ea016619193533f9ac6cd1d8ae22d58
Use your desired "GitHub Gist ID" for the id
GET query parameter in the example requests below. The Rust
code in that Gist will be used for
the query.
-
Run the code:
GET /?id=1ea016619193533f9ac6cd1d8ae22d58
http://localhost:8080/?id=1ea016619193533f9ac6cd1d8ae22d58 -
Run the test suite:
GET /test?id=1ea016619193533f9ac6cd1d8ae22d58
http://localhost:8080/test?id=1ea016619193533f9ac6cd1d8ae22d58 -
Build the code:
GET /build?id=1ea016619193533f9ac6cd1d8ae22d58
http://localhost:8080/build?id=1ea016619193533f9ac6cd1d8ae22d58 -
Build and output WebAssembly of the code:
GET /wasm?id=1ea016619193533f9ac6cd1d8ae22d58
http://localhost:8080/wasm?id=1ea016619193533f9ac6cd1d8ae22d58 -
Build and output Assembly of the code:
GET /asm?id=1ea016619193533f9ac6cd1d8ae22d58
http://localhost:8080/asm?id=1ea016619193533f9ac6cd1d8ae22d58
-
Build the dependencies image:
./deps.sh
-
Build the production image:
./prod.sh
-
Run the Docker container:
./start.sh
-
Stop the Docker container when finished:
./stop.sh