Skip to content

infant-lang/sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infant Lang Playground Sandbox API

Dependencies

Environment Variables

  • PORT: The port to run the sandbox on. Change the value in the .env file or do manual port forwarding.

Info

  • It uses a modified version of the Infant Lang Interpreter for the playground.
  • Uses Mux for routing.
  • interpreter.go is the main file for the interpreter.

API

  • GET /api/stable/play/ - Returns READY to indicate that the sandbox is ready to receive the POST request. (This is used because of the cold boot times of the Dyno instances)

  • POST /api/stable/play/ - The POST request should contain the code to be executed.

    • Body:
      • data: The stringified JSON object containing the code to be executed.
    • Response:
      • JSON Object containing the result of the code execution.

The JSON object should contain the following fields:

{
    "code": string[] // array of lines of code
}

Deployment

Build

  • go build .

Enjoy 🎉