ktor icon indicating copy to clipboard operation
ktor copied to clipboard

Allow dynamic routing

Open kkriske opened this issue 6 years ago • 8 comments

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

possible use cases:

  • runtime modifiable modular system in which the plugins provide the routes.
  • feature switch, enable/disable routes dynamically

kkriske avatar Oct 26 '17 11:10 kkriske

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

stale[bot] avatar Sep 24 '19 13:09 stale[bot]

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

dhakehurst avatar Nov 11 '19 15:11 dhakehurst

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

stale[bot] avatar Feb 09 '20 16:02 stale[bot]

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

cy6erGn0m avatar Feb 09 '20 17:02 cy6erGn0m

Any updates on implementation of this feature?

Animeshz avatar May 18 '20 12:05 Animeshz

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

oleg-larshin avatar Aug 10 '20 15:08 oleg-larshin

Is there any news about this feature?

ymind avatar Mar 01 '21 08:03 ymind

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.

DEADMC avatar Feb 07 '23 11:02 DEADMC