Coder Social home page Coder Social logo

code_runner's Introduction

Introduction

This project is based on https://github.com/prasmussen/glot-code-runner, it provides a golang based webserver to run the code using https://echo.labstack.com. Now this project support Python/Golang, will consider to add more language support.

Run in Docker

To run this in docker

docker pull naughtytao/code_runner
docker run -p 8080:8080 naughtytao/code_runner

or you can start https with

docker run -p 8080:8080 naughtytao/code_runner -s

The you can test it with curl

curl \
  -X POST \
  http://localhost:8080/run \
  -H 'Content-Type: application/json' \
  -d '{"language":"python","files":[{"name":"main.py","content":"print(42)"}]}'

in case you are using https, run following test

curl \
  -X POST \
  https://localhost:8080/run \
  -H 'Content-Type: application/json' \
  -d '{"language":"python","files":[{"name":"main.py","content":"print(42)"}]}'\
  -k

The following result should return

{"stdout":"42\n","stderr":"","error":""}

Build/Develop Locally

To build this projetc locally, create a root dir, and then create src dir under root dir. checkout this project into root/src dir and run

export GOPATH= <root>
make compile

code_runner's People

Stargazers

高亚斌 avatar Anil Gulecha avatar Jia Wan avatar Jonathan Rodriguez avatar  avatar Anil Wadghule avatar

Watchers

Jian Zhang avatar James Cloos avatar Gang Tao avatar

code_runner's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.