-
application.yml
ktor: server: path: "/kamo" port: 8008 host: "127.0.0.1"
-
routing
- KtorRouter
@Controller // or @Component class TestController : KtorRouter { override fun Routing.register() { get("/a") { a() } get("/b") { b() } } suspend fun PipelineContext<Unit, ApplicationCall>.a() { call.respondText { "a" } } suspend fun PipelineContext<Unit, ApplicationCall>.b() { call.respondText { "b" } } }
- KtorRouterFun (KtorRouterFun = Routing.() -> Unit)
@Component class TestRouting { @Bean fun c(): KtorRouterFun = { get("/c") { call.respondText { "c" } } } @Bean fun d(): KtorRouterFun = { get("/d") { call.respondText { "d" } } } }
- RoutingExtensionFun
@Component class TestRouting { fun Routing.e() { get("/e"){ call.respondText { "e" } } } }
-
module
- KtorModule
@Component class TestModule : KtorModule { override fun Application.install() { // ... } }
- KtorModuleFun (KtorModuleFun = Application.() -> Unit)
@Component class TestModule { @Bean fun module(): KtorModuleFun = { // ... } }
- ApplicationExtensionFun
@Component class TestModule { fun Application.module() { // ... } }
-
Notifications
You must be signed in to change notification settings - Fork 1
KAMO030/ktor-spring-boot-starter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|