ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort
https://ktor.io
Apache License 2.0
12.49k stars 1.02k forks source link

Allow dynamic routing #237

Open kkriske opened 6 years ago

kkriske commented 6 years ago

Add support for modifying routes at runtime, possibly in a separate feature so default behaviour is immutable.

possible use cases:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity.

dhakehurst commented 4 years ago

has this ever been addressed...or just gone stale? I'm interested in the feature

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity.

cy6erGn0m commented 4 years ago

This requires design. It's not clear how it should work, how it should look and what API should it provide.

Animeshz commented 4 years ago

Any updates on implementation of this feature?

oleg-larshin commented 3 years ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

ymind commented 3 years ago

Is there any news about this feature?

DEADMC commented 1 year ago

well I did something like this:

routing {
    val pathPart = "/{something}"
    var pathString = ""
    for (i in 1..4) {
        pathString += pathPart
        get(pathString) {
            getCustomResponse(call.request.uri)
        }
    }
}

and in getCustomResponse I parse uri and return response depends on what we need.