Live-coding a web server with Ktor

Overview

ktor-sample

Live-coding a web server with Ktor

Ktor is a Kotlin framework dedicated to building asynchronous servers and clients in connected systems. In this session, I will explain and demo the core concepts of Ktor 2 by live coding an HTTP server from scratch using Ktor Server. Also, we'll take an overview of Ktor Client, from setting it up to making requests and installing plugins.

Getting Started

The purpose of this live session will be to send a POST request with a list of names to our web server and our web server will send a random value from this list. It’s a very simple call but it covers a lot of things from Ktor.

openapi: 3.0.3
info:
  version: 1.0.0
  title: Am Stram Gram
  description: We are hiring
  contact:
    email: [email protected]

servers:
  - url: http://localhost:8080

paths:
  "/random":
    post:
      summary: Randomize
      operationId: randomize
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostRandomRequest"
        description: Value we want to randomize
        required: true
      responses:
        "201":
          description: Returns a random value
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PostRandomResponse"							
components:
  schemas:
    PostRandomRequest:
      type: object
      required:
        - names
      properties:
        names:
          type: array
          items:
            type: string
    PostRandomResponse:
      type: object
      required:
        - random
      properties:
        random:
          type: string
You might also like...
Server & Web App of Tolgee localization toolkit
Server & Web App of Tolgee localization toolkit

Server & Web App of Tolgee localization toolkit

Gallery application using Unsplash API, coding by Android Kotlin
Gallery application using Unsplash API, coding by Android Kotlin

Gallery App GalleryApp is application show image from Unsplash API, based on MVVM architecture. Download Go to the Releases to download the latest APK

A coding examples project about Kotlin Programming language. 🇰
A coding examples project about Kotlin Programming language. 🇰

Kotlin Tutorial 👨🏻‍💻 What is Kotlin ❓ Kotlin is a new programming language, developed by JetBrains. Jetbrains is a popular software development com

Allowing server admins to backdoor their own server!

DiscordBackdoorBot Allowing server admins to backdoor their own server! What does Discord Backdoor Bot do? Discord Backdoor bot allows the bot owner t

Jambeez-server - Jambeez server with kotlin

jambeez-server How to start Start your own server with: docker pull ghcr.io/jamb

Use Android Data Binding wih Live Data to glue View Model and Android

Gruop-C Spliff Summary Use Android Data Binding wih Live Data to glue View Model and Android. Asynchronous communications implemented with KotlinX Cor

Live currency app in Uzbek sum
Live currency app in Uzbek sum

currencyApp Pro currency rate App Currency Converter providing real time exchange rates for over 180+ currencies and countries.  You can setup persona

LiveDataCallAdapter - Live Data Call Adapter Factory

LiveDataCallAdapterFactory based on retrofit, the LiveData returned by the restf

Owner
Renaud Mathieu
Android Software Engineer
Renaud Mathieu
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Jorge Sánchez Fernández 29 Oct 3, 2022
KTor-Client---Android - The essence of KTor Client for network calls

KTor Client - Android This project encompasses the essence of KTor Client for ne

Mansoor Nisar 2 Jan 18, 2022
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

mohamed tamer 5 Jan 22, 2022
Sencilla aplicación web para realizar un CRUD usando Ktor y motores de plantillas similar a Laravel con PHP

Servicio web para crear una WEB App usando Kotlin y Kator así como otras tecnologías propuestas por JetBrains.

José Luis González Sánchez 1 Feb 12, 2022
sample project that shows you how you can use Ktor to creat a server for real Project.

Ktor-Sample This is a sample project that shows you how you can use Ktor to creat a server for real Project. What is done Save data to database (Get a

Mohamed Emad 4 Dec 23, 2022
🍣✨ Simple Ktor server to handle GitHub -> YouTrack, usually for YouTrack Standalone.

?? sushi Simple Ktor server to handle GitHub Issues to YouTrack, usually for YouTrack Standalone. Why? There is not really a definite way to handle Gi

Noelware 2 Nov 11, 2021
Provides Ktor Server libs for building awesome Kotlin plugins which needs to provide builtin HTTP servers

Ktor Plugin Provides Ktor Server libs for building awesome Kotlin plugins which needs to provide builtin HTTP servers. Requires: https://github.com/Po

null 0 Nov 13, 2021
Plugin to integrate EventStoreDB into Ktor-Server!

Ktor Plugin EventStoreDB EventStoreDB is an open-source database technology that stores your critical data in streams of immutable events. It was buil

null 7 Sep 1, 2022
User Authentication ( Compose Ktor Server MongoDB)

Utilising Security in android for Authentication and Authorization for Android I would be using mongo db to perform all basic operations no need for f

Michael Enoma 0 May 2, 2022
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Achmad Ichsan Thaib 8 Nov 22, 2022