Coder Social home page Coder Social logo

code_eval's Introduction

CodeEval

CodeEval is a Phoenix application that provides an API endpoint to dynamically evaluate Elixir code snippets. It's designed for simplicity and ease of use with basic authentication for secure access.

Getting Started

To start the CodeEval server:

  • Install dependencies with mix setup.
  • Start the Phoenix endpoint with mix phx.server or within IEx using iex -S mix phx.server.

After starting the server, you can access the application at localhost:4000 from your browser.

API Usage

The application exposes a single API endpoint to evaluate Elixir code:

  • POST /api/run: This endpoint accepts a JSON payload with Elixir code and returns the evaluation result.

Request Format

{
  "code": "Elixir code here"
}

Response Format

On successful evaluation including output (e.g. IO.puts):

{
  "result": "Evaluation result",
  "output": "Evaluation output"
}

On error:

{
  "error": "Error message"
}

Authentication

The API uses an API key for authentication. When making requests to the /api/run endpoint, you need to include an X-Api-Key header with your API key. The header should be in the following format:

X-Api-Key: your_api_key_here

code_eval's People

Contributors

isavita avatar

Stargazers

Nikola Djordjevic avatar

Watchers

 avatar

Forkers

marinac-dev

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.