package Ġkw ang Ċ Ċ import Ġkw ang . backend . lw an . L wan Config Ċ import Ġkw ang . backend . lw an . Server L wan Ċ import Ġkw ang . extension . json Ċ import Ġkw ang . extension . plain Ċ import Ġkw ang . extension . with Headers Ċ import Ġkw ang . interceptor . Cors Interceptor Ċ import Ġkw ang . type . Header Ċ import Ġkw ang . type . StatusCode Ċ Ċ class ĠSample Handler Ġ: ĠK wang Handler ("/") Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġhandle Get ( request : ĠRequest Context , Ġresponse : ĠResponse Context ): ĠStatusCode Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Auth : Ġ${ request . authorization }") ĊĠĠĠĠĠĠĠ Ġprintln (" Origin :" Ġ+ Ġrequest . getHeader (" Origin ")) ĊĠĠĠĠĠĠĠ Ġresponse Ġwith Headers ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠHeader (" mean ing - of - life ", Ġ" 4 2 "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠHeader (" looking - for ", Ġ" job ") ĊĠĠĠĠĠĠĠ Ġ) Ġplain Ġ(" 1 2 3 ") ĊĠĠĠĠĠĠĠ Ġreturn ĠStatusCode ( 2 0 0 u ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠOther Sample Ġ: ĠK wang Handler ("/ hello ") Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġhandle Get ( request : ĠRequest Context , Ġresponse : ĠResponse Context ): ĠStatusCode Ġ{ ĊĠĠĠĠĠĠĠ Ġresponse Ġjson Ġ( """ {" hello ":" ${ request . getQuery (" name ")} "} """) ĊĠĠĠĠĠĠĠ Ġreturn ĠStatusCode ( 2 0 0 u ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠ ĠServer L wan ( ĊĠĠĠĠĠĠĠ ĠlistOf ( Sample Handler (), ĠOther Sample ()), ĠL wan Config (" localhost : 8 0 8 1 "), ĊĠĠĠĠĠĠĠ ĠlistOf ( Cors Interceptor (" http :// google . com ")) ĊĠĠĠ Ġ) Ċ } Ċ