Ktor 1.4.1 don't support the embeddedServer(engine, port, host) form

333 views Asked by At

I use Ktor version 1.4.1. The follow code

    fun startNettyServer() {
        val server : NettyApplicationEngine = embeddedServer(Netty, port = 8080)
        server.start(true)
    }

and the compilation error is

src\main\kotlin\ar\com\craneado\app\config\AppConfig.kt:36:69: error: cannot find a parameter with this name: port val server : NettyApplicationEngine = embeddedServer(Netty, port = 8080)

src\main\kotlin\ar\com\craneado\app\config\AppConfig.kt:36:80: error: no value passed for parameter 'environment' val server : NettyApplicationEngine = embeddedServer(Netty, port = 8080)

but the api supports it https://api.ktor.io/1.4.1/io.ktor.server.engine/embedded-server.html

Someone knows something about it

0

There are 0 answers