Debug standalone mode, plus various bugfixes
This commit is contained in:
@@ -108,7 +108,9 @@
|
||||
<directory>${project.build.directory}/generated-resources/css</directory>
|
||||
<targetPath>css</targetPath>
|
||||
<includes>
|
||||
<include>index.css</include>
|
||||
<include>main.css</include>
|
||||
<include>tour.css</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</webResources>
|
||||
|
@@ -6,14 +6,17 @@ import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import okhttp3.internal.EMPTY_REQUEST
|
||||
import org.jeudego.pairgoth.web.WebappManager
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
class ApiTool {
|
||||
companion object {
|
||||
const val JSON = "application/json"
|
||||
const val XML = "application/xml"
|
||||
val apiRoot = System.getProperty("pairgoth.api.external.url")?.let { "${it.removeSuffix("/")}/" }
|
||||
?: throw Error("no configured API url")
|
||||
val apiRoot by lazy {
|
||||
WebappManager.getProperty("api.external.url")?.let { "${it.removeSuffix("/")}/" }
|
||||
?: throw Error("no configured API url")
|
||||
}
|
||||
val logger = LoggerFactory.getLogger("api")
|
||||
}
|
||||
private val client = OkHttpClient()
|
||||
|
@@ -19,7 +19,9 @@ class ApiServlet : AsyncProxyServlet() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val apiRoot = System.getProperty("pairgoth.api.external.url")?.let { "${it.removeSuffix("/")}" }
|
||||
?: throw Error("no configured API url")
|
||||
private val apiRoot by lazy {
|
||||
WebappManager.getProperty("api.external.url")?.let { "${it.removeSuffix("/")}" }
|
||||
?: throw Error("no configured API url")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import javax.servlet.http.HttpServletResponse
|
||||
|
||||
class ImportServlet: HttpServlet() {
|
||||
|
||||
private val api = ApiTool()
|
||||
private val api by lazy { ApiTool() }
|
||||
|
||||
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
|
||||
val uploads = Upload.handleFileUpload(req)
|
||||
|
Reference in New Issue
Block a user