Skip to content

Commit

Permalink
Add Kotlin example, align formatting of polyglot verticle examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bertjan committed Oct 5, 2017
1 parent f203a70 commit f0e64e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions helloworld/src/main/groovy/MyFirstGroovyVerticle.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vertx.createHttpServer().requestHandler({ req ->
req.response().end("Hello world from Groovy!")
}).listen(8080)
vertx.createHttpServer()
.requestHandler({ req -> req.response().end("Hello world from Groovy!") })
.listen(8080)
6 changes: 3 additions & 3 deletions helloworld/src/main/js/MyFirstJSVerticle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vertx.createHttpServer().requestHandler(function (req) {
req.response().end('Hello world from JavaScript!');
}).listen(8080);
vertx.createHttpServer()
.requestHandler(function (req) { req.response().end('Hello world from JavaScript!'); })
.listen(8080);
11 changes: 11 additions & 0 deletions helloworld/src/main/kotlin/MyFirstKotlinVerticle.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import io.vertx.core.*
import io.vertx.kotlin.core.http.HttpServerOptions

class MyFirstKotlinVerticle : AbstractVerticle() {

override fun start() {
vertx.createHttpServer()
.requestHandler({ req -> req.response().end("Hello world from Kotlin!") })
.listen(8080)
}
}

0 comments on commit f0e64e3

Please sign in to comment.