hello :wave: is it possible to inject <plugin> to ...
# ktor
d
hello 👋 is it possible to inject plugin to a specific order in the pipeline? i.e. I'm writing a plugin that automatically configures
ContentNegotiation
and
Routing
plugins so was wondering what would be the order of execution if users specify another plugin (e.g. CORS) current flow
<request> --> ContentNegotiation --> Routing --> [my plugin app logic] -> <response>
expected usage
Copy code
fun Application.myModule() {
    install(MyPlugin) { // configuration }
}
Guessing the plugin execution order is implied by the code order but just want to double check, e.g.
Copy code
fun Application.myModule() {
    install(CORS) // runs before my plugin
    install(MyPlugin) { // configuration }
    install(Foo) // can process response of my plugin
}
a
The order of execution depends on what phases in what pipelines plugins intercept. Only if plugins intercept the same phase in the same pipeline, the order is determined by the order of
install
calls.