sandbox

command module
v0.0.0-...-3a891a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 9 Imported by: 0

README

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 🎉

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL