Codable Routing with Kitura
summary
Kitura 2.0 takes JSON duties off handlers so routes accept and return Swift types directly, cutting boilerplate and leaving only business logic. Examples implement GET /commits, POST /commit and GET by author using JSONEncoder/JSONDecoder and handler signatures that receive Codable types. KituraKit enables sharing the same model definitions with iOS, and a Swift query ORM demo shows saving via Model.save. A client library encapsulates encode + network + decode and it works end-to-end.
AI-written summary · about
chapters (21)
- 0:00Intro
- 0:31About me
- 1:58A Javascript example
- 3:27Foundation Pre-Swift 4
- 4:04SwiftyJSON relief
- 4:36Enter Swift 4
- 5:07Conforming to Encodable
- 5:55Conforming to Decodable
- 6:05Decoding
- 6:20There's a lot more to it ...
- 10:03GET all commits
- 13:28Codable Routing
- 14:29POST a Commit
- 14:53Codable Query Parameters
- 15:35Saving to a database
- 16:07Swift-Kuery ORM
- 16:40In a parallel universe ...
- 17:26Kiturakit
- 18:39End-to-End
- 19:21Sharing Code
- 19:48Get your hands dirty
related talks
23mServer-side Swift with Kitura
19mAll you need is Swift
26mServer Side Swift - IBM Kitura with OpenShift
26mSwift Services are Simple
37mCodeable in Swift 4
45mswiftui view codable – transforming swiftui to json for a fully backend driven ui
25mJourney Of Codable
21mBuilding asynchronous API with Ktor & Kotlin
