- 
                Notifications
    You must be signed in to change notification settings 
- Fork 41
Ktor
        morfeusys edited this page Mar 19, 2020 
        ·
        1 revision
      
    Ktor is a framework for building asynchronous servers. It allows you to quickly setup any HTTP server like Netty or Jetty and serve your JAICF agent.
This server can be used with any channel that implements HttpBotChannel interface.
Learn more about channels here.
implementation("io.ktor:ktor-server-netty:1.3.1")or
implementation("io.ktor:ktor-server-jetty:1.3.1")Use httpBotRouting extension to create a routing for HttpBotChannel endpoints.
fun main() {
    embeddedServer(Netty, 8000) {
        routing {
            httpBotRouting(
                "/alexa" to AlexaChannel(gameClockBot),
                "/actions" to ActionsFulfillment.dialogflow(gameClockBot)
            )
        }
    }.start(wait = true)
}The same for Jetty server.
