Deploy JudgeLib as a standalone microservice with REST API endpoints for maximum scalability and flexibility.
Try our hosted microservice instance
https://judge-microser.onrender.com/
Note: This demo service runs on a free tier and may experience occasional downtime or restarts. If you encounter a 502 error, please try again in a few minutes or consider pinging the workers
{ "message": "All workers completed", "jobId": "sum of number", "results": [ { "input": "5 1 2 3 4 5", "expected_output": "15", "result": "15", "correct": true, "timeout": "2" } ] }
curl -X POST https://judge-microser.onrender.com/api/c/run \ -F "code=./code.cpp" \ -F "ques_name=sum of number" \ -F "timeout=2" \ -F "sizeout=1" \ -F "input=5 1 2 3 4 5 ### 3 1 2 3 ### 2 1 4..." \ -F "output=15 ### 6 ### 5 .." \ -F "language=cpp"
Use JudgeLib from any programming language or framework via simple HTTP requests.
Scale your code execution capacity by deploying multiple instances behind a load balancer.
Run code execution in a completely isolated environment, separate from your main application.
{ "ques_name":"dummy", // required "language": "python", // required: programming language "code": ./code.py, // required: path of source code "output": "dummy_output" // required: output for the program (cannot be empty) seperated by ### "input": "dummy_input", // required: input for the program (cannot be empty) seperated by ### "timeout": 5, // optional: timeout in seconds "sizeout":2 }
curl -X POST https://judge-microser.onrender.com/api/c/run \ -F "code=@code.cpp" \ -F "ques_name=sum of number" \ -F "timeout=2" \ -F "sizeout=1" \ -F "input=5 1 2 3 4 5" \ -F "output=15" \ -F "language=cpp"
const response = await fetch('https://judge-microser.onrender.com/api/c/run', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ ques_name:"dummy_name", language: 'py', code: './code.py', //file path and key should be code input: 'dummy_input', // Required - cannot be empty (seperated bt ###) output: '1 ### 2 ', // Required - cannot be empty (seperated bt ###) timeout: 5, sizeout: 2 }) }); const result = await response.json(); console.log(result);