1 / 6

Creating a RESTful Web Service using Kotlin and Spring Boot

Kotlin has emerged as a big player among modern technology. With Google providing first hand support and announcing it as the official language for Android Development it is clear that Kotlin is here to stay.<br><br>Kotlin has emerged as a big player among modern technology. With Google providing first hand support and announcing it as the official language for Android Development it is clear that Kotlin is here to stay.

byteridge
Download Presentation

Creating a RESTful Web Service using Kotlin and Spring Boot

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Byteridge Creating a RESTful Web Service using Kotlin and Spring Boot

  2. Byteridge Introduction • Kotlin has emerged as a big player among modern technology. With Google providing first hand support and announcing it as the official language for Android Development it is clear that Kotlin is here to stay. • Kotlin has emerged as a big player among modern technology. With Google providing first hand support and announcing it as the official language for Android Development it is clear that Kotlin is here to stay. • Spring Boot is one of the more popular frameworks for creating web services. Spring Framework 5 comes with Kotlin support. This means that Spring Boot 2.x will have first class support for Kotlin.

  3. Byteridge Creating a simple REST controller with Spring Boot • Create a new project using the + New Project button and select ‘Spring Initializer’ and click next. • Give a name to your group and artifact. Select Type as Gradle and language as Kotlin and we will be using JAR packaging for our project and click next. • We will be using the latest stable version of Spring so select that from the options available.

  4. Byteridge Creating a simple REST controller with Spring Boot • We can also search for and select which spring boot starters we want to use. Since this will be a react REST service we want reactive web. Select and click Next. • Give your project a name and click Finish. • After the project builds we can see a Kotlin directory has been created along with a standard default Spring boot application class.

  5. Byteridge Creating a simple REST controller with Spring Boot • We will not create a RestController class. To keep things simple we will put it in the same Kotlin file. We will use the @RestController annotation and create a simple method which will return Flux, a constant stream of data.(This is where the reactive part comes in). • As a modal we will create a Kotlin data class which will accept 3 parameters in its constructor. (These will be returned in the Api response.) • Now, We will return Flux from our prices method. We will be using the interval method for returning the prices at 1 second interval. Prices will be generated randomly between 0 to 100.

  6. Byteridge CONTACT US Contact:+91 40491 74522 Mail : info@byteridge.com Address: WeWork Rajapushpa Summit, Financial District, Hyderabad, Telangana Visit here for more : https://www.byteridge.com/technology-trends/creating-a-restful-web-service-using-kotlin-and-spring-boot/

More Related