Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ktor

Ktor is a powerful Kotlin framework for building client-server applications.

We focus here on the server side of things. We will show how Ktor can be used to build a classic web server that delivers static HTML or dynamically constructed HTML to a browser. We will also show how a Ktor server can be tested, using Kotest to handle the assertions.

Ktor can be used in many other ways that we will not cover here—e.g., to create WebSocket applications that support real-time data exchange between client and server. You should consult the Ktor documentation if you want to know more about these advanced topics.

There are some GitHub repositories that may be of interest if you wish to dig deeper into Ktor:

  • awesome-ktor is a curated list of links to Ktor resources

  • ktor-samples is a collection of various example applications

  • The ktor-documentation repository has a huge set of code snippets demonstrating how to accomplish many of the things you might need to do in a Ktor application

You may find these helpful when working on your group projects in Semester 2…