Dynamic code execution API supporting multiple languages and database-backed problem management.
http://localhost:3000
Interactive docs are available at: http://localhost:3000/docs
Retrieve a summary of all problems in the database. Supports filtering by category or tag.
- URL:
/problems - Method:
GET - Query Parameters:
category: Filter by category name (e.g.,/problems?category=Math)tag: Filter by tag name (e.g.,/problems?tag=String)
- Response:
200 OK
{
"status": "success",
"data": [
{ "id": "uuid", "title": "Two Sum", "difficulty": "easy" }
]
}Retrieve specific problem metadata, configuration, and public test cases.
- URL:
/problem/<problem_id> - Method:
GET - Response:
200 OK
Run code against test cases associated with a specific problem.
- URL:
/code/<problem_id> - Method:
POST - Body:
{
"language": "python",
"code": "print('hello')"
}Run arbitrary code without a pre-defined problem.
- URL:
/run?lang=python - Method:
POST - Body:
{
"code": "print('hello world')"
}Toggle cheat mode on/off. When enabled, all code execution will return "passed" for all test cases.
- URL:
/cheat-flip - Method:
POST - Body:
{
"cheat-code": "your-raw-secret-passphrase"
}- Notes:
- The secret is validated using a constant-time SHA-256 comparison.
- The state is held in-memory and resets on server restart.
- Python:
python - JavaScript:
javascript - Java:
java - C:
c - C++:
cpp