package Ġguide . howto . nest able _ routes Ċ Ċ import Ġorg . http 4 k . core . Method . DELETE Ċ import Ġorg . http 4 k . core . Method . GET Ċ import Ġorg . http 4 k . core . Method . POST Ċ import Ġorg . http 4 k . core . Request Ċ import Ġorg . http 4 k . core . Response Ċ import Ġorg . http 4 k . core . Status . Companion . OK Ċ import Ġorg . http 4 k . core . then Ċ import Ġorg . http 4 k . filter . Debugging Filters . Print Request And Response Ċ import Ġorg . http 4 k . routing . Resource Loader . Companion . Classpath Ċ import Ġorg . http 4 k . routing . and Ċ import Ġorg . http 4 k . routing . bind Ċ import Ġorg . http 4 k . routing . header Ċ import Ġorg . http 4 k . routing . headers Ċ import Ġorg . http 4 k . routing . path Ċ import Ġorg . http 4 k . routing . queries Ċ import Ġorg . http 4 k . routing . routes Ċ import Ġorg . http 4 k . routing . single Page App Ċ import Ġorg . http 4 k . routing . static Ċ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġroutes With Filter Ġ= ĊĠĠĠĠĠĠĠ ĠPrint Request And Response (). then ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġroutes ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"/ get /{ name }" Ġbind ĠGET Ġto Ġ{ Ġreq : ĠRequest Ġ-> ĠResponse ( OK ). body ( req . path (" name ") !! ) Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"/ post /{ name }" Ġbind ĠPOST Ġto Ġ{ ĠResponse ( OK ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġprintln ( routes With Filter ( Request ( GET , Ġ"/ get / value "))) ĊĊĠĠĠ Ġval Ġstatic With Filter Ġ= ĠPrint Request And Response (). then ( static ( Classpath (" guide / howto / nest able _ routes "))) ĊĠĠĠ Ġval Ġapp Ġ= Ġroutes ( ĊĠĠĠĠĠĠĠ Ġ"/ bob " Ġbind Ġroutes With Filter , ĊĠĠĠĠĠĠĠ Ġ"/ static " Ġbind Ġstatic With Filter , ĊĠĠĠĠĠĠĠ Ġ"/ pattern /{ rest : .* }" Ġbind Ġ{ Ġreq : ĠRequest Ġ-> ĠResponse ( OK ). body ( req . path (" rest ") Ġ?: Ġ"") Ġ}, ĊĠĠĠĠĠĠĠ Ġ"/ rit a " Ġbind Ġroutes ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"/ delete /{ name }" Ġbind ĠDELETE Ġto Ġ{ ĠResponse ( OK ) Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"/ post /{ name }" Ġbind ĠPOST Ġto Ġ{ ĠResponse ( OK ) Ġ} ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ Ġ"/ matching " Ġbind ĠGET Ġto Ġroutes ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġheader (" required header ", Ġ" some value "). and ( queries (" required query ")) Ġbind Ġ{ ĠResponse ( OK ). body (" matched Ġ 2 Ġparameters ") Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġheaders (" required header ") Ġbind Ġ{ ĠResponse ( OK ). body (" matched Ġ 1 Ġparameters ") Ġ} ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ Ġsingle Page App ( Classpath (" guide / howto / nest able _ routes ")) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ bob / get / value "))) ĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ static / some Static File . txt "))) ĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ pattern / some / ent ire / pattern / we / want / to / capture "))) ĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ matching "). header (" required header ", Ġ" some value "). query (" required query ", Ġ" some value "))) ĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ matching "). header (" required header ", Ġ" some value "))) ĊĠĠĠ Ġprintln ( app ( Request ( GET , Ġ"/ some Sp a Resource "))) Ċ } Ċ