Spine is a library for *declaring Ktor endpoints i...
# feed
c
Spine is a library for declaring Ktor endpoints in common code:
Copy code
val listUsers by get()
    .response<List<User>>()

val createUser by post()
    .request<UserCreationDto>()
    .response<User>()
Copy code
route(Users.createUser) {
    val created = userService.create(
        username = body.username,  // Automatic type-safe access to the body
        age = body.age,
    )

    respond(created)  // Automatic type-safe serialization of the response
}
Copy code
val user = client.request(User.createUser, UserCreationDto("Bob", 21))  // Automatic type-safe body as a parameter
    .bodyOrThrow()  // Automatic type-safe deserialization of the response
In Spine 0.9.0, introducing: • Type-safe error managementA brand new documentation website! spine.opensavvy.dev • Chat in #C078Z1QRHL3
❤️ 7
a
This is really nice @CLOVIS
thank you color 1