https://kotlinlang.org logo
#ktor
Title
# ktor
j

jeggy

11/13/2019, 8:58 PM
are there any examples on how to create a ktor
Feature
which would add a route to the RoutingFeature?
b

BorzdeG

11/14/2019, 3:50 AM
Copy code
fun installRouting(routing: Routing) {
		  routing.route("/") {
				get {
...
				}
		  }
	 }
Copy code
fun Application.main() {
    routing {
        installRouting(this)
    }
}
j

jeggy

11/14/2019, 12:00 PM
But it's not possible to do something like this as a feature? I want to do that along side having access to the
ApplicationCallPipeline
b

BorzdeG

11/14/2019, 4:22 PM
image.png
2 Views