CodeLand Runner is a lightweight HTTP server designed to execute code snippets and return the results. It is primarily used in conjunction with the CodeLand Manager project for managing code execution on remote runners.
The CodeLand Runner provides a simple HTTP interface for executing code snippets and retrieving the results in a structured JSON format. It can be easily integrated into various systems that require remote code execution capabilities.
This repository contains the CodeLand Runner code, which is a part of the CodeLand Manager ecosystem.
To use the CodeLand Runner, you'll typically follow these steps:
-
Compile the Code: Compile the CodeLand Runner code using the provided build script or your preferred method. Ensure that all dependencies, including the cJSON library, are correctly set up.
-
Run the Server: Start the CodeLand Runner server on the desired host and port. By default, it listens on port 15000, but you can customize it by setting the
runnerPort
environment variable. -
Send Requests: Use HTTP requests to send code snippets to the CodeLand Runner for execution. You can send POST requests with a JSON payload containing the code to be executed. The runner will execute the code and return the results.
-
Receive Results: Parse the JSON response from the CodeLand Runner to retrieve the execution results. The response includes a "res" field containing the base64-encoded output of the executed code.
Here's an example of sending a POST request to execute code with the CodeLand Runner using curl
:
curl -X POST http://localhost:15000 -d '{"code": "echo \"Hello, CodeLand!\"" }'
The response will be a JSON object with the execution result:
{
"res": "SGVsbG8sIENvZGVMYW5kIQo="
}
This project is licensed under the MIT License - see the LICENSE file for details.
- William Mantly ([email protected])
This README was generated with ❤️ by an AI language model.