Table of Contents
CSharpRepl is a web service that provides C# interactive features over http. This service was developed to provide REPL capability in the C# Discord via the MODiX Discord Bot.
Clone and open the project in your favorite IDE/Editor!
- Install Visual Studio Code, Visual Studio 2019, or Rider
- Install the dotnet SDK
- Install Docker
- (Optional) Install docker-compose
Note: The container will cleanly exit after every request, or after 30 seconds with an active request. Use --restart=always to ensure the container remains available.
Command line:
docker run -d --user www-data --restart=always --read-only --tmpfs /tmp --tmpfs /var --memory 500M --cpus 2 -p 31337:31337 -e ASPNETCORE_URLS=http://+:31337 ghcr.io/discord-csharp/csharprepl:latestDocker Compose:
version: '3.7'
services:
  repl:
    image: ghcr.io/discord-csharp/csharprepl:latest
    restart: always
    read_only: true
    user: www-data
    environment: 
      - ASPNETCORE_URLS=http://+:31337
    ports:
      - '31337:31337'
    tmpfs:
      - /tmp
      - /varcurl -X POST -H 'Content-Type: text/plain' -d 'Console.WriteLine("Hello World");' http://localhost:31337/evalInvoke-WebRequest -UseBasicParsing -ContentType text/plain -Method POST -Body "Console.WriteLine(`"Hello World`");" -Uri http://localhost:31337/eval | Select-Object ContentSee the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Chris Curwick - @Cisien on Discord
Project Link: https://github.com/discord-csharp/CSharpRepl