Created
November 13, 2019 12:47
-
-
Save alphaho/2a9efc1b735279cdfa714efffa9c2f6f to your computer and use it in GitHub Desktop.
integrate http4k into Spring application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Bean | |
| fun http4kServletRegistrationBean(): ServletRegistrationBean<HttpHandlerServlet> { | |
| val app = routes("/webapi/hello" bind GET to { request: Request -> | |
| Response(OK).body("Hello!") | |
| }) | |
| val servlet = app.asServlet() | |
| return ServletRegistrationBean<HttpHandlerServlet>(servlet, "/webapi/*") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment