diff --git a/api-webapp/pom.xml b/api-webapp/pom.xml index 1a29b18..b704082 100644 --- a/api-webapp/pom.xml +++ b/api-webapp/pom.xml @@ -78,11 +78,15 @@ jetty-maven-plugin ${jetty.version} + 0 + + 8085 + /api/ - + diff --git a/client.sh b/client.sh new file mode 100755 index 0000000..2b3ae84 --- /dev/null +++ b/client.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5006" +#mvn --projects view-webapp -Dpairgoth.api.url=http://localhost:8085/api/ package jetty:run-war +mvn --projects view-webapp package jetty:run-war diff --git a/debug.sh b/debug.sh deleted file mode 100755 index beadb52..0000000 --- a/debug.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -mvn package && java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5006 -jar application/target/pairgoth-engine.jar diff --git a/run.sh b/run.sh deleted file mode 100755 index a0cf0d2..0000000 --- a/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -mvn package && java -jar application/target/pairgoth-engine.jar diff --git a/server.sh b/server.sh new file mode 100755 index 0000000..9669179 --- /dev/null +++ b/server.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005" +mvn --projects api-webapp package jetty:run-war diff --git a/standalone.sh b/standalone.sh new file mode 100755 index 0000000..bd21b39 --- /dev/null +++ b/standalone.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# debug version +# mvn package && java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5006 -jar application/target/pairgoth-engine.jar + +mvn package && java -jar application/target/pairgoth-engine.jar diff --git a/view-webapp/csswatch.sh b/view-webapp/csswatch.sh new file mode 100755 index 0000000..ec802fb --- /dev/null +++ b/view-webapp/csswatch.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +mvn com.gitlab.haynes:libsass-maven-plugin:0.2.29:watch diff --git a/view-webapp/pom.xml b/view-webapp/pom.xml index 43a4e1a..669113f 100644 --- a/view-webapp/pom.xml +++ b/view-webapp/pom.xml @@ -101,11 +101,11 @@ ${jetty.version} 0 + + 8080 + - - pairgoth.webapp.url - http://localhost:8080 - + http://localhost:8085/api/ diff --git a/view-webapp/src/main/config/pairgoth.default.properties b/view-webapp/src/main/config/pairgoth.default.properties index d8376ef..1f7ab92 100644 --- a/view-webapp/src/main/config/pairgoth.default.properties +++ b/view-webapp/src/main/config/pairgoth.default.properties @@ -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 diff --git a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/view/ApiTool.kt b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/view/ApiTool.kt index 2c790c1..7c498c7 100644 --- a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/view/ApiTool.kt +++ b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/view/ApiTool.kt @@ -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)