This pull request contains the initial implementation of the HTTP API for this project. Currently, the only supported endpoint is /execute/, where is one of the supported languages (currently python or java). This endpoint responds to POST requests with a JSON body in the form {"Code": "<code>"} where <code> is the code to be executed, and responds with JSON in the form {"Stdout": "<output>" }.
Structure
The HTTP server implementation in the net/http package relies on a ServeMux type to determine how any requests should be handled (and call the appropriate handlers).
server.go handles setting up the server, while server_serve_mux.go handles creating a ServeMux instance and its associated request handlers.
Summary
This pull request contains the initial implementation of the HTTP API for this project. Currently, the only supported endpoint is /execute/, where is one of the supported languages (currently python or java). This endpoint responds to POST requests with a JSON body in the form
{"Code": "<code>"}
where<code>
is the code to be executed, and responds with JSON in the form{"Stdout": "<output>" }
.Structure
The HTTP server implementation in the net/http package relies on a ServeMux type to determine how any requests should be handled (and call the appropriate handlers).
server.go
handles setting up the server, whileserver_serve_mux.go
handles creating a ServeMux instance and its associated request handlers.