package Ġcom . line corp . spring react . controller Ċ Ċ import Ġcom . line corp . spring react . renderer . React Renderer Ċ import Ġcom . line corp . spring react . repository . Post Repository Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ @ Controller Ċ class ĠWeb Controller Ġ{ ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġrenderer : ĠReact Renderer ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġpost Repository : ĠPost Repository ĊĊĠĠĠ Ġ@ GetMapping ( path Ġ= ĠarrayOf ("", Ġ"/ ")) ĊĠĠĠ Ġfun Ġget Comments ( response : ĠHttpServletResponse ) Ġ{ ĊĠĠĠĠĠĠĠ Ġresponse . setHeader (" Content - Type ", Ġ" text / html "); ĊĠĠĠĠĠĠĠ Ġresponse . writer . write ( renderer . render ( hash Map Of (" posts " Ġto ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhash Map Of (" data " Ġto Ġpost Repository . get Posts ())) )) ĊĠĠĠ Ġ} Ċ }