In the Ktor `server()` function in suspendApp libr...
# arrow
d
In the Ktor
server()
function in suspendApp library, is there a way to add a
connector { }
for an internal port?
s
It exposes the exact same API as the original
embeddedServer
API from Ktor except as an extension on
ResourceScope
.
d
There's a bunch of overrides to that api... one of them is:
Copy code
CoroutineScope.embeddedServer(
    factory: ApplicationEngineFactory<TEngine, TConfiguration>,
    vararg connectors: EngineConnectorConfig = arrayOf(EngineConnectorBuilder()),
    watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH),
    parentCoroutineContext: CoroutineContext = EmptyCoroutineContext,
    configure: TConfiguration.() -> Unit = {},
    module: Application.() -> Unit
): TEngine
and another one receives a
applicationEngineEnvironment
... those can configure multiple connectors... but the one you wrap only provides one port.
s
Then it should be added to SuspendApp Ktor
d
Yeah. I could just write my own, though I'd suppose more people could benefit from this 😊.
Oh... can't just copy and alter the existing implementation:
Another reason to have in in suspendApp 🙈
A PR to SuspendApp would be greatly appreciated.
d
I could see if I have a bit of time (a bit too much to do now...), but how could I get around this meanwhile?
Well, I guess I'd give up on that watchPaths for now then...