@@ -52,103 +52,7 @@ remove [aws-serverless-container](https://github.com/awslabs/aws-serverless-java
5252
5353## API Documentation :page_with_curl :
5454
55- ### Execute Kotlin code on JVM
56-
57- ``` shell script
58- curl -X POST \
59- http://localhost:8080/api/compiler/run \
60- -H ' Content-Type: application/json' \
61- -d ' {
62- "args": "1 2 3",
63- "files": [
64- {
65- "name": "File.kt",
66- "text": "fun main() {\n println(\"123\")\n}"
67- }
68- ]
69- }'
70- ```
71-
72- ### Translate Kotlin code to JavaScript code
73-
74- ``` shell script
75- curl -X POST \
76- http://localhost:8080/api/compiler/translate \
77- -H ' Content-Type: application/json' \
78- -d ' {
79- "args": "1 2 3",
80- "files": [
81- {
82- "name": "File.kt",
83- "text": "fun main(args: Array<String>) {\n println(args[0])\n }"
84- }
85- ]
86- }'
87- ```
88-
89- ### Run Kotlin tests
90-
91- ``` shell script
92- curl -X POST \
93- http://localhost:8080/api/compiler/test \
94- -H ' Content-Type: application/json' \
95- -d ' {
96- "files": [
97- {
98- "name": "File.kt",
99- "text": "fun start(): String = \"OK\""
100- },
101- {
102- "name": "test0.kt",
103- "text": "import org.junit.Assert\nimport org.junit.Test\n\nclass TestStart {\n @Test fun testOk() {\n Assert.assertEquals(\"OK\", start())\n }\n}"
104- },
105- {
106- "name": "test1.kt",
107- "text": "package koans.util\n\nfun String.toMessage() = \"The function ' \' ' $this' \' ' is implemented incorrectly\"\n\nfun String.toMessageInEquals() = toMessage().inEquals()\n\nfun String.inEquals() = this"
108- }
109- ]
110- }'
111- ```
112-
113- ### Get code completions for a specified place in code
114-
115- ``` shell script
116- curl -X POST \
117- ' http://localhost:8080/api/compiler/complete?line=2&ch=15' \
118- -H ' Content-Type: application/json' \
119- -d ' {
120- "files": [
121- {
122- "name": "File.kt",
123- "text": "fun main() {\n val sinusoid = \"sinusoid\"\n val s = sin\n}"
124- }
125- ]
126- }'
127- ```
128-
129- ### Get code analysis results
130-
131- ``` shell script
132- curl -X POST \
133- http://localhost:8080/api/compiler/highlight \
134- -H ' Content-Type: application/json' \
135- -d ' {
136- "files": [
137- {
138- "name": "File.kt",
139- "text": "fun main() {\n println(\"Hello, world!!!\")ass\n val random = Random\n}"
140- }
141- ]
142- }'
143- ```
144-
145- ### Get the current Kotlin version
146-
147- ``` shell script
148- curl -X GET http://localhost:8080/versions
149- ```
150-
151- The server also supports an [ API] ( https://github.com/JetBrains/kotlin-playground ) for the Kotlin Playground library.
55+ Swagger url: http://localhost:8080/swagger-ui/
15256
15357## How to add your dependencies to kotlin compiler :books :
15458
0 commit comments