All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fireflysource.example.HttpServerRouterContextDemo.kt Maven / Gradle / Ivy

The newest version!
package com.fireflysource.example

import com.fireflysource.`$`

fun main() {
    `$`.httpServer()
        .router().get("/").handler { ctx ->
            ctx.attributes["router1"] = "Some one visits the /. "
            ctx.write("Hello world! ").next()
        }
        .router().get("/").handler { ctx ->
            val data = ctx.attributes["router1"]
            ctx.end("The router data: $data")
        }
        .listen("localhost", 8090)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy