Pythia-server: REST API to execute code and tasks on the Pythia platform

Pythia is a framework deployed as an online platform whose goal is to teach programming and algorithm design. The platform executes the code in a safe environment and its main advantage is to provide intelligent feedback to its users to suppor their learning. More details about the whole project can be found on the official website of Pythia.

Pythia-server is one frontend for the Pythia framework. It offers a REST API to execute code and tasks on the Pythia platform. It also includes functions to manage and create tasks and environments and to get health information about the Pythia backbone. Pythia-server is written in Go.

Quick install

The pythia-server frontend can be run on Linux, Windows and macOS.

Start by installing required dependencies:

  • Go (1.11 or later)

Then, clone the Git repository, and launch the installation:

> git clone https://github.com/pythia-project/pythia-server.git
> cd pythia-server
> go build

Once successfully installed, you can launch the server:

> ./pythia-server

You can now try to execute a simple task (assuming that you launched the pythia-core framework with a queue listening on port 9000) by calling the /api/execute route, for example with the curl tool:

> curl -d '{"tid": "hello-world"}' http://localhost:8080/api/execute

and you will see, among others, Hello world! printed in your terminal.

Contents

This documentation is split into two parts: the first one is targeter to users and the second one is for developers. In any case, we recommend you to first read the user’s documentation to understand how to use and test the server.