lkelly93 / scheduler

Schedules and runs foreign code sequentially.
MIT License
0 stars 1 forks source link

Write Server Package #15

Closed joshua-sterner closed 4 years ago

joshua-sterner commented 4 years ago

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, while server_serve_mux.go handles creating a ServeMux instance and its associated request handlers.