Skip to content

Ankan002/compile-me-api

Repository files navigation

Compiler API

Logo Image

This project is a standalone api that can be used to compile code on web on the fly.

Go Docker GitHub DigitalOcean

Installation Guide 🛠

Via Docker

  • Run the following command
docker run -d -p 8000:8000 -e PORT={PORT} ankan02/compile-me-api:0.0.2
  • Replace PORT with the port of your choice.
  • Also replace 8000:8000 with the CONTAINER_PORT:PORT.

Via Github

  • First install the following compilers:

    • MinGW (C/C++)
    • JDK (Java)
    • NodeJS v18 (Javascript)
    • Python v3.10 (Python)
    • TSNode (Typescript)
    • Golang
    • Rust
    • Kotlin
    • Mono MCS (C#)
  • Now to clone the GitHub Repository run the following command:

git clone https://github.com/Ankan002/compile-me-api.git
  • The go into the directory using the following command:
cd compile-me-api
  • Now install the all the required dependencies using the following command:
go mod tidy
  • Then create two files for the environment variables

    • .env
    • .env.production
  • Now fill the .env file with the following variables:

Variable Description Value
PORT Port on which app will
be running.
Valid PORT Number
GO_ENV Used define the environment
in which you want
to run the code
development (You might
use production but that
will not load the
environment variables)
  • Also, if you want to run the software using docker, then fill the .env.production with the following variables:
Variable Description Value
PORT Port on which app will
be running.
Valid PORT Number
  • Now to run the project simply use the following command:
go run main.go
  • Optionally, you might prefer to run it via Docker, then simply run:
docker compose up
  • Congratulations... you have a running app. 🎉🎉... Enjoy...

Contributors

Support My Work

BuyMeACoffee

Releases

No releases published

Packages

No packages published