diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fffa0569 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:slim + +RUN apt update && apt install -y git + +WORKDIR /usr/src/jslt + +COPY . . + +RUN ./gradlew :playground:shadowJar + +EXPOSE 9999 + +CMD ["java", "-cp", "playground/build/libs/playground-0.0.1-all.jar", "no.priv.garshol.jslt.playground.PlaygroundServer", "9999"] diff --git a/playground/README.md b/playground/README.md index 5a5e7f6f..fe2e4eb8 100644 --- a/playground/README.md +++ b/playground/README.md @@ -1,4 +1,3 @@ - # JSLT Playground To build the playground yourself, simply do: @@ -15,5 +14,12 @@ To run it, give this command: java -cp playground/build/libs/playground-0.0.1-all.jar no.priv.garshol.jslt.playground.PlaygroundServer 9999 & ``` +or use Docker + +``` +docker build -t jslt . +docker run -p 9999:9999 jslt +``` + Then go to `http://localhost:9999/jslt` and you'll have the playground right there. diff --git a/playground/src/main/resources/lambda.html b/playground/src/main/resources/lambda.html index 8453f236..8373d526 100644 --- a/playground/src/main/resources/lambda.html +++ b/playground/src/main/resources/lambda.html @@ -38,8 +38,8 @@ var data = {"json" : input, "jslt" : jslt } var http = new XMLHttpRequest(); - var url = "jslt-demo"; - //var url = "http://localhost:9999/jslt"; + var url = "jslt"; + http.open("POST", url, true); http.setRequestHeader("Content-type", "application/json");