Setting up standalone/client/server run scripts

This commit is contained in:
Claude Brisson
2023-06-12 08:12:58 +02:00
parent 7a5502a29f
commit 2ae8657b83
10 changed files with 31 additions and 17 deletions

3
view-webapp/csswatch.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
mvn com.gitlab.haynes:libsass-maven-plugin:0.2.29:watch

View File

@@ -101,11 +101,11 @@
<version>${jetty.version}</version>
<configuration>
<scan>0</scan>
<httpConnector>
<port>8080</port>
</httpConnector>
<systemProperties>
<systemProperty>
<name>pairgoth.webapp.url</name>
<value>http://localhost:8080</value>
</systemProperty>
<pairgoth.api.url>http://localhost:8085/api/</pairgoth.api.url>
</systemProperties>
</configuration>
</plugin>

View File

@@ -1,7 +1,7 @@
# webapp
env = dev
webapp.url = https://localhost:8080
api.url = https://localhost:8085
api.url = https://localhost:8085/api
# store
store = file

View File

@@ -11,11 +11,9 @@ class ApiTool {
companion object {
const val JSON = "application/json"
val apiRoot =
(System.getProperty("pairgoth.api.url") ?: System.getProperty("pairgoth.webapp.url"))
.let { base ->
if (base.endsWith('/')) "${base}api/"
else "${base}/api/"
}
System.getProperty("pairgoth.api.url")?.let { "${it.removeSuffix("/")}/" }
?: System.getProperty("pairgoth.webapp.url")?.let { "${it.removeSuffix("/")}/api/" }
?: throw Error("no configured API url")
}
private val client = OkHttpClient()
private fun prepare(url: String) = Request.Builder().url("$apiRoot$url").header("Accept", JSON)