setlX Playground is a webapp that allows you to write and execute setlX code in the browser. You can run it yourself or use the one hosted on my webserver: Demo.
- ✨ Write, run and share code in the browser
- 📚 Share your code with other people
- ⚡️ Embed a code snippet into your own website
- 🔒 The code is executed in a safe java sandbox with no read or write access to the filesystem
There are three different methods to build and run the playground. But first you need to clone the repository:
$ git clone https://github.com/KeKsBoTer/setlXPlayground
Docker is a great tool to run the playground and even can be used to deploy it on a server.
# build the image
$ docker build -t setlxplayground .
# run the container
$ docker run -p 8080:80 setlxplayground
Or just use docker-compose
$ docker-compose up
You can download the latest release of the playground here. Keep in mind that releases are usually behind the master branch. Once you downloaded a release, started it with
# (on Windows use setlxplayground.exe)
./setlxplayground -host 8080
To get a full description for all flags run setlxplayground -help
First make sure that you have go version 1.11 or higher installed.
Then you can build the application:
Linux/macOS
$ GO111MODULE=on go build -o setlxplayground .
Windows (PowerShell)
$ $env:GO111MODULE="on"
$ go build -o setlxplayground.exe .
Now the playground can be started with
# (on Windows use setlxplayground.exe)
./setlxplayground -host 8080
To get a full description for all flags run setlxplayground -help
Since you can share your code via a URL the application needs to store your code in a database. Setlx playground uses the key-value store badger for that. This means the database is managed by the application at runtime. The database's location can be specified with the -db
flag when starting the application.