Fix server logs coloring
This commit is contained in:
@@ -10,10 +10,12 @@ import okhttp3.internal.EMPTY_REQUEST
|
||||
class ApiTool {
|
||||
companion object {
|
||||
const val JSON = "application/json"
|
||||
val apiRoot = System.getProperty("pairgoth.api.url").let { base ->
|
||||
if (base.endsWith('/')) "${base}api/"
|
||||
else "${base}/api/"
|
||||
}
|
||||
val apiRoot =
|
||||
(System.getProperty("pairgoth.api.url") ?: System.getProperty("pairgoth.webapp.url"))
|
||||
.let { base ->
|
||||
if (base.endsWith('/')) "${base}api/"
|
||||
else "${base}/api/"
|
||||
}
|
||||
}
|
||||
private val client = OkHttpClient()
|
||||
private fun prepare(url: String) = Request.Builder().url("$apiRoot$url").header("Accept", JSON)
|
||||
|
Reference in New Issue
Block a user