Skip to content

Instantly share code, notes, and snippets.

View manish-manghwani's full-sized avatar
💬

Manish Manghwani manish-manghwani

💬
View GitHub Profile
@manish-manghwani
manish-manghwani / 1. RouteProcessor.kt
Created July 20, 2024 08:45 — forked from SubSide/1. RouteProcessor.kt
An easy way to register controller methods in Ktor. This helps clean up some code.
import io.ktor.application.ApplicationCall
import io.ktor.application.call
import io.ktor.http.HttpMethod
import io.ktor.routing.Route
import io.ktor.routing.Routing
import io.ktor.routing.route
import kotlin.reflect.KFunction
import kotlin.reflect.full.callSuspendBy
import kotlin.reflect.full.declaredMemberFunctions
import kotlin.reflect.jvm.javaType