HTML DSL 4.Features get("/html-dsl") { call.respondHtml { head { link(rel = "stylesheet", href = "/styles.css", type = "text/css") } body { h1 { +"HTML" } ul { for (n in 1..10) { li { +"$n" } } } p("myclass") { +"I am using myclass" } } } } Kotlinのコードを使用してHTMLを 生成できるようになります。
CORS 4.Features install(CORS) { method(HttpMethod.Options) method(HttpMethod.Put) method(HttpMethod.Delete) method(HttpMethod.Patch) header(HttpHeaders.Authorization) header("MyCustomHeader") allowCredentials = true anyHost() // @TODO: Don't do this in production if possible. Try to limit it. } オリジン間リソース共有(CORS) を有効にする為の設定が行えま す。 (HTTPメソッドの追加、ヘッダーの 追加等)