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

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

The newest version!
package com.fireflysource.example

import com.fireflysource.`$`

fun main() {
    `$`.httpServer()
        .router().post("/product").handler {
            throw IllegalStateException("Create product exception")
        }
        .listen("localhost", 8090)

    val url = "http://localhost:8090"
    `$`.httpClient().post("$url/product/").submit()
        .thenAccept { response -> println(response) }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy