Rest Microframework Jooby

In this post I want to introduce the Jobby microframework for Kotlin and Java. They don’t have a nice getting started site yet so I decided to make a quick write up. We will write a small rest service in Kotlin for managing persons. This web service is going to take up under 30 lines of code. Starting up We will use Gradle to build our rest application. mkdir kotlin_jooby cd kotlin_jooby gradle init --dsl kotlin src/build.
Read more...

Minimal Webservice with data classes and spring boot data rest

Spring Boot Data REST and Kotlin data classes enable an very code efficient way to provide CRUD Interfaces. We will create a small webservice for managing persons. Setting up For this tutorial we will use gradle with kotlin dsl to build the application. mkdir spring_data_class cd spring_data_class gradle init --dsl kotlin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 plugins { kotlin("jvm") version "1.
Read more...

Part 2: Accessing the webservice with KTor client

In the last post Part 1 we created a simple webservice for organising tasks. This time we will access this service using the KTor client features. Setting up For this tutorial we will use gradle with kotlin dsl to build the application. mkdir kotlin_ktor_client cd kotlin_ktor_client gradle init --dsl kotlin plugins { application kotlin("jvm") version "1.3.0" } application { mainClassName = "client.ClientKt" } dependencies { compile(kotlin("stdlib")) compile("io.ktor:ktor-client-core:1.0.0") compile("io.ktor:ktor-client-apache:1.0.0") } repositories { mavenCentral() jcenter() } // We need this task to package the client into a jar task("packageClient", type = Jar::class) { from(configurations.
Read more...

Part 1: Building a simple web service with KTor

Ktor recently reached version 1.0.0 which motivated me to write this blog post. In this tutorial we will create a simple webservice for adding and listing tasks using the Kotlin framework Ktor. Ktor is a framework to build asynchronous server and client applications. Setting up For this tutorial we will use gradle with kotlin dsl to build the test application. mkdir kotlin_ktor cd kotlin_ktor gradle init --dsl kotlin plugins { application kotlin("jvm") version "1.
Read more...