This commit is contained in:
@@ -9,12 +9,10 @@ import io.ktor.gson.*
|
||||
import io.ktor.features.*
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.engine.apache.*
|
||||
import com.fasterxml.jackson.databind.*
|
||||
import io.ktor.jackson.*
|
||||
import io.ktor.auth.*
|
||||
import kotlin.reflect.*
|
||||
import java.util.*
|
||||
import io.ktor.swagger.experimental.*
|
||||
import org.apache.http.HttpException
|
||||
|
||||
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)
|
||||
|
||||
@@ -24,10 +22,6 @@ fun Application.module(testing: Boolean = false) {
|
||||
install(ContentNegotiation) {
|
||||
gson {
|
||||
}
|
||||
|
||||
jackson {
|
||||
enable(SerializationFeature.INDENT_OUTPUT)
|
||||
}
|
||||
}
|
||||
|
||||
val client = HttpClient(Apache) {
|
||||
@@ -49,19 +43,16 @@ fun Application.module(testing: Boolean = false) {
|
||||
exception<AuthenticationException> { cause ->
|
||||
call.respond(HttpStatusCode.Unauthorized)
|
||||
}
|
||||
|
||||
exception<AuthorizationException> { cause ->
|
||||
call.respond(HttpStatusCode.Forbidden)
|
||||
}
|
||||
|
||||
exception<HttpException> { cause ->
|
||||
call.respond(cause.code, cause.description)
|
||||
exception<HttpException> { cause ->
|
||||
call.respond(HttpStatusCode.BadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
get("/json/jackson") {
|
||||
call.respond(mapOf("hello" to "world"))
|
||||
}
|
||||
|
||||
OutputServiceRDBServer().apply {
|
||||
registerOutput()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user