Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isundaylee/code_runner
A simple Sinatra app that runs scripts (currently supports Ruby and Python) and returns the output (stdout, stderr, as well as status code) in JSON format.
https://github.com/isundaylee/code_runner
Last synced: 29 days ago
JSON representation
A simple Sinatra app that runs scripts (currently supports Ruby and Python) and returns the output (stdout, stderr, as well as status code) in JSON format.
- Host: GitHub
- URL: https://github.com/isundaylee/code_runner
- Owner: isundaylee
- Created: 2016-01-24T14:34:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-29T17:46:59.000Z (almost 9 years ago)
- Last Synced: 2023-03-23T01:52:07.634Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Runner
Code Runner is a simple Sinatra app that runs scripts (currently supports Ruby and Python) and returns the output (stdout, stderr, as well as status code) in JSON format.
# Usage
To run the server,
```
rackup -p 3000
```To run code, simply make a POST request to the root URL, with the parameter `code` being the file that you want to run. For example,
```
curl "localhost:3000" -F "code=@/somewhere/hello_world.py"
```would give
```
{"stdout":"Hello, world! \n","stderr":"","status":0,"success":true}
```