Setting up standalone/client/server run scripts
This commit is contained in:
3
view-webapp/csswatch.sh
Executable file
3
view-webapp/csswatch.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
mvn com.gitlab.haynes:libsass-maven-plugin:0.2.29:watch
|
@@ -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>
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user