A collection of automation functions for Ktor Server applications
- Automatic Routing
- Mark a class with the
@Service(path: String)annotation - Mark any routes with a
@RequestMethodannotation such as@Getor@Post - Mark all parameters with a
@RequestParameterannotation such as@Bodyor@Query - Return a type that implements
BaseResponse<T : BaseResponse>
- Mark a class with the
// Application.kt
fun main(args: Array<String>) {
io.ktor.server.netty.EngineMain.main(args) // Use whichever server you'd like
}
fun Application.module() {
installServiceAnnotatedRoutes()
}- Basic Global Error Handling
- Currently returns a Json response unless the request was formatted in a way which the service could not respond.