orangy
AntBat
08/14/2018, 12:30 PMfrancis
08/22/2018, 11:02 AMhhariri
Francis
08/23/2018, 1:59 PMSetting up a Gradle Build
than continue on with Guide - How to create an API using ktor
It will not work, because the setup is incompletePamela Hill
09/10/2018, 11:12 AMLeoColman
09/11/2018, 2:35 AMleandro
09/11/2018, 8:16 AMgildor
09/11/2018, 8:24 AM!!
in most casesHexa
09/13/2018, 5:51 PMclass ValidateUserHandler : RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
private val logger = Logger.getLogger(ValidateUserHandler::class.java)
override fun handleRequest(input: APIGatewayProxyRequestEvent?, context: Context?): APIGatewayProxyResponseEvent {
try {
val token: String? by lazy {
if (input!!.headers["Authorization"]?.startsWith("Bearer ") == true) {
val token = input.headers["Authorization"]?.substring("Bearer ".length)?.trim()
if (!token.isNullOrEmpty()) token else null
} else {
null
}
}
val authoriserResult = validateToken(token!!)
return when (authoriserResult.authorised) {
true -> {
APIGatewayProxyResponseEvent()
.withBody("OK")
.withStatusCode(200)
}
else -> {
APIGatewayProxyResponseEvent()
.withBody("Unauthorized}")
.withStatusCode(401)
}
}
} catch (ex: Exception) {
logger.error("Unexpected error occured: $ex", ex)
return APIGatewayProxyResponseEvent()
.withBody("System error")
.withStatusCode(500)
}
}
}
tipsy
09/13/2018, 5:59 PMtipsy
09/13/2018, 5:59 PMbdawg.io
09/16/2018, 10:40 PMorangy
Ramon Pires da Silva
09/21/2018, 8:29 PMoctylFractal
09/22/2018, 8:45 AMjava.lang.AssertionError: annotation tree hasn't been attributed yet: @kotlin.Metadata(mv = {1, 1, 13}, bv = {1, 0, 3}, k = 1, d1 ... (omitted for brevity)
It seems to go away when I disable correctErrorTypes
, but then dagger
doesn't work, so I can't do that.octylFractal
09/22/2018, 8:47 AMoctylFractal
09/22/2018, 9:22 AMsdeleuze
10/02/2018, 2:09 PMkenkyee
10/02/2018, 2:12 PMpeekandpoke
10/09/2018, 2:01 PMtipsy
10/11/2018, 5:41 PMfrellan
10/14/2018, 12:29 PMEdgars
10/14/2018, 12:30 PMenleur
10/14/2018, 12:30 PMEdgars
10/14/2018, 12:42 PMaddamsson
10/14/2018, 3:00 PMaddamsson
10/14/2018, 3:00 PMaddamsson
10/14/2018, 3:01 PMaddamsson
10/14/2018, 3:01 PMkotlinx.html
to generate html