View packaging still in progress

This commit is contained in:
Claude Brisson
2023-06-12 06:42:38 +02:00
parent a8d4649404
commit 3ff885a7c1
9 changed files with 53 additions and 20 deletions

View File

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

View File

@@ -10,7 +10,7 @@ import okhttp3.internal.EMPTY_REQUEST
class ApiTool {
companion object {
const val JSON = "application/json"
val apiRoot = System.getProperty("pairgoth.webapp.url").let { base ->
val apiRoot = System.getProperty("pairgoth.api.url").let { base ->
if (base.endsWith('/')) "${base}api/"
else "${base}/api/"
}

View File

@@ -42,7 +42,7 @@ class LanguageFilter : Filter {
// the request must be redirected
val preferredLanguage = getPreferredLanguage(request)
val destination = if (lang != null) target else uri
response.sendRedirect("${preferredLanguage}${destination}")
response.sendRedirect("/${preferredLanguage}${destination}")
}
}
}

View File

@@ -51,7 +51,7 @@ class WebappManager : ServletContextListener, ServletContextAttributeListener, H
/* ServletContextListener interface */
override fun contextInitialized(sce: ServletContextEvent) {
context = sce.servletContext
logger.info("---------- Starting Web Application ----------")
logger.info("---------- Starting Pairgoth Web Client ----------")
context.setAttribute("manager", this)
webappRoot = context.getRealPath("/")
try {