Building asynchronous API with Ktor & Kotlin
summary
Shows a small Ktor project scaffolded for Kotlin using Ktor + coroutines and JSON serialization, with Application.kt, routing extensions, a fake Map repository and a service layer. Implements full CRUD: GET returns list, POST receives JSON and returns HTTP 201, GET by id validates params and returns 400/404, PUT updates, DELETE returns 204 when removed. Uses suspend handlers so threads stay nonblocking, recommends Exposed ORM for real DBs, and the demo runs with expected HTTP status codes.
AI-written summary · about
chapters (7)
- 0:00Ktor and async APIs
- 2:13Ktor project setup
- 7:11Simple API with Ktor
- 10:27GET requests & database
- 13:01Parameters & error handling
- 15:37PUT/DELETE with coroutines
- 18:59Summary & resources
related talks
37mKotlin on the server with Ktor
53mServer-Side Development with Ktor
43mUsing Ktor 3.0 with All the Shiny Things
51mFunctional fashion for Kotlin projects
28mBackend Engineering for Android Developers
46mIntroduction to Ktor
21mLive-coding a web server with Ktor
50mKotlin and Spring boot a pleasant experience and some rough edges
