diff --git a/.gitignore b/.gitignore
index 7815b8a..990d7fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ target
/pairgoth.properties
*.err
/tournamentfiles
+*.iml
\ No newline at end of file
diff --git a/README.md b/README.md
index 788607c..10d50d5 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
├── docker .................................... Docker packaging
│ ├── pairgoth.properties.example ........... Docker property file to instanciate
│ └── run.sh ................................ Docker launch script
-└── webapp .................................... Engine web application
+└── api-webapp ................................ Engine web application
└── src
├── main
│ ├── kotlin ........................ Engine kotlin sources (the real meat is here!)
@@ -26,10 +26,10 @@
└── kotlin ........................ Engine webapp API unit tests
```
-## Webapp sources structure
+## API Webapp sources structure
```
-webapp/src/main/kotlin/org/jeudego/pairgoth
+api-webapp/src/main/kotlin/org/jeudego/pairgoth
├── api .................................... API handlers
├── ext .................................... External: import/export features
├── model .................................. Domain logic model
diff --git a/webapp/pom.xml b/api-webapp/pom.xml
similarity index 91%
rename from webapp/pom.xml
rename to api-webapp/pom.xml
index 0270a8c..bd4cc47 100644
--- a/webapp/pom.xml
+++ b/api-webapp/pom.xml
@@ -9,7 +9,7 @@
engine-parent
1.0-SNAPSHOT
- webapp
+ api-webapp
war
${project.groupId}:${project.artifactId}
@@ -51,25 +51,6 @@
org.apache.maven.plugins
maven-enforcer-plugin
-
-
- enforce-properties-file-exists
-
- enforce
-
-
-
-
- Missing pairgoth.properties file
-
- ${project.parent.basedir}/pairgoth.properties
-
-
-
- true
-
-
-
org.apache.maven.plugins
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ApiHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairgothApiHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairgothApiHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairgothApiHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairgothApiHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairingHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairingHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairingHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PairingHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/PlayerHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PlayerHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/PlayerHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/PlayerHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/ResultsHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ResultsHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/ResultsHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/ResultsHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/TeamHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/TeamHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/TeamHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/TeamHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/api/TournamentHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/TournamentHandler.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/api/TournamentHandler.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/TournamentHandler.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Defs.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Defs.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Defs.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Defs.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Game.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/TimeSystem.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/TimeSystem.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/TimeSystem.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/TimeSystem.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/FacebookHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/FacebookHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/FacebookHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/FacebookHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/GoogleHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/GoogleHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/GoogleHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/GoogleHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/InstagramHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/InstagramHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/InstagramHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/InstagramHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OAuthHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OAuthHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OAuthHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OAuthHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OauthHelperFactory.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OauthHelperFactory.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OauthHelperFactory.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/OauthHelperFactory.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/TwitterHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/TwitterHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/TwitterHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/oauth/TwitterHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/HistoryHelper.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/MacMahonSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/MacMahonSolver.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/MacMahonSolver.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/MacMahonSolver.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Solver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Solver.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Solver.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/Solver.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/SwissSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/SwissSolver.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/SwissSolver.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/SwissSolver.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/store/MemoryStore.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/MemoryStore.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/store/MemoryStore.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/MemoryStore.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/store/Store.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/Store.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/store/Store.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/Store.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/store/StoreImplementation.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/StoreImplementation.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/store/StoreImplementation.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/StoreImplementation.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/util/Colorizer.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/Colorizer.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/util/Colorizer.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/Colorizer.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/util/JsonIO.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/JsonIO.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/util/JsonIO.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/JsonIO.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlFormat.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlFormat.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlFormat.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlFormat.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlUtils.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlUtils.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlUtils.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/util/XmlUtils.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiException.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiException.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiException.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiException.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiServlet.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiServlet.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiServlet.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/ApiServlet.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/Event.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/Event.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/Event.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/Event.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/Logging.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/Logging.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/Logging.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/Logging.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/SSEServlet.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/SSEServlet.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/SSEServlet.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/SSEServlet.kt
diff --git a/webapp/src/main/kotlin/org/jeudego/pairgoth/web/WebappManager.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/WebappManager.kt
similarity index 100%
rename from webapp/src/main/kotlin/org/jeudego/pairgoth/web/WebappManager.kt
rename to api-webapp/src/main/kotlin/org/jeudego/pairgoth/web/WebappManager.kt
diff --git a/webapp/src/main/webapp/WEB-INF/jetty-web.xml b/api-webapp/src/main/webapp/WEB-INF/jetty-web.xml
similarity index 100%
rename from webapp/src/main/webapp/WEB-INF/jetty-web.xml
rename to api-webapp/src/main/webapp/WEB-INF/jetty-web.xml
diff --git a/webapp/src/main/webapp/WEB-INF/pairgoth.default.properties b/api-webapp/src/main/webapp/WEB-INF/pairgoth.default.properties
similarity index 100%
rename from webapp/src/main/webapp/WEB-INF/pairgoth.default.properties
rename to api-webapp/src/main/webapp/WEB-INF/pairgoth.default.properties
diff --git a/webapp/src/main/webapp/WEB-INF/web.xml b/api-webapp/src/main/webapp/WEB-INF/web.xml
similarity index 98%
rename from webapp/src/main/webapp/WEB-INF/web.xml
rename to api-webapp/src/main/webapp/WEB-INF/web.xml
index 4d50f1b..719647e 100644
--- a/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/api-webapp/src/main/webapp/WEB-INF/web.xml
@@ -41,7 +41,7 @@
api
- /api/*
+ /*
sse
diff --git a/webapp/src/test/kotlin/.gitkeep b/api-webapp/src/test/kotlin/.gitkeep
similarity index 100%
rename from webapp/src/test/kotlin/.gitkeep
rename to api-webapp/src/test/kotlin/.gitkeep
diff --git a/webapp/src/test/kotlin/BasicTests.kt b/api-webapp/src/test/kotlin/BasicTests.kt
similarity index 100%
rename from webapp/src/test/kotlin/BasicTests.kt
rename to api-webapp/src/test/kotlin/BasicTests.kt
diff --git a/webapp/src/test/kotlin/ImportExportTests.kt b/api-webapp/src/test/kotlin/ImportExportTests.kt
similarity index 100%
rename from webapp/src/test/kotlin/ImportExportTests.kt
rename to api-webapp/src/test/kotlin/ImportExportTests.kt
diff --git a/webapp/src/test/kotlin/TestBase.kt b/api-webapp/src/test/kotlin/TestBase.kt
similarity index 100%
rename from webapp/src/test/kotlin/TestBase.kt
rename to api-webapp/src/test/kotlin/TestBase.kt
diff --git a/webapp/src/test/kotlin/TestUtils.kt b/api-webapp/src/test/kotlin/TestUtils.kt
similarity index 100%
rename from webapp/src/test/kotlin/TestUtils.kt
rename to api-webapp/src/test/kotlin/TestUtils.kt
diff --git a/webapp/src/test/resources/opengotha/frioul-2018.xml b/api-webapp/src/test/resources/opengotha/frioul-2018.xml
similarity index 100%
rename from webapp/src/test/resources/opengotha/frioul-2018.xml
rename to api-webapp/src/test/resources/opengotha/frioul-2018.xml
diff --git a/webapp/src/test/resources/opengotha/veterans-2021.xml b/api-webapp/src/test/resources/opengotha/veterans-2021.xml
similarity index 100%
rename from webapp/src/test/resources/opengotha/veterans-2021.xml
rename to api-webapp/src/test/resources/opengotha/veterans-2021.xml
diff --git a/application/pom.xml b/application/pom.xml
index 1a126b2..faf561e 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -15,7 +15,7 @@
${project.groupId}
- webapp
+ api-webapp
${project.version}
war
diff --git a/application/src/assembly/livewar.xml b/application/src/assembly/livewar.xml
index 58f0085..e547269 100644
--- a/application/src/assembly/livewar.xml
+++ b/application/src/assembly/livewar.xml
@@ -20,7 +20,7 @@
true
false
- ${project.groupId}:webapp
+ ${project.groupId}:api-webapp
${project.groupId}:bootstrap
diff --git a/container/src/main/java/org/jeudego/pairgoth/container/ServerMain.java b/container/src/main/java/org/jeudego/pairgoth/container/ServerMain.java
index 76b47e4..e9d1f65 100644
--- a/container/src/main/java/org/jeudego/pairgoth/container/ServerMain.java
+++ b/container/src/main/java/org/jeudego/pairgoth/container/ServerMain.java
@@ -25,11 +25,11 @@ import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.webapp.WebAppContext;
@@ -41,7 +41,8 @@ public class ServerMain
PROD
}
- private Path basePath;
+ private Path apiBasePath = null;
+ private Path viewBasePath = null;
public static void main(String[] args)
{
@@ -59,15 +60,25 @@ public class ServerMain
{
// create server and web context
Server server = new Server(8080);
- WebAppContext context = new WebAppContext() {
+
+ WebAppContext apiContext = new WebAppContext() {
@Override
public boolean isServerResource(String name, URL url)
{
return super.isServerResource(name, url) || url.getFile().contains("/WEB-INF/jetty-server/");
}
};
- context.setContextPath("/");
+ apiContext.setContextPath("/api");
+ WebAppContext viewContext = new WebAppContext() {
+ @Override
+ public boolean isServerResource(String name, URL url)
+ {
+ return super.isServerResource(name, url) || url.getFile().contains("/WEB-INF/jetty-server/");
+ }
+ };
+ viewContext.setContextPath("/");
+
// pairgoth runtime properties
File properties = new File("./pairgoth.properties");
if (properties.exists()) {
@@ -77,7 +88,7 @@ public class ServerMain
String property = (String)entry.getKey();
String value = (String)entry.getValue();
if (property.startsWith("logger.")) {
- context.setInitParameter("webapp-slf4j-logger." + property.substring(7), value);
+ apiContext.setInitParameter("webapp-slf4j-logger." + property.substring(7), value);
} else {
System.setProperty("pairgoth." + property, value);
}
@@ -88,21 +99,29 @@ public class ServerMain
{
case PROD:
// Configure as WAR
- context.setWar(basePath.toString());
+ apiContext.setWar(apiBasePath.toString());
+ viewContext.setWar(viewBasePath.toString());
break;
case DEV:
// Configuring from Development Base
- context.setBaseResource(new PathResource(basePath.resolve("src/main/webapp")));
+
+ apiContext.setBaseResource(new PathResource(apiBasePath.resolve("src/main/webapp")));
// Add webapp compiled classes & resources (copied into place from src/main/resources)
- Path classesPath = basePath.resolve("target/webapp/WEB-INF/classes");
- context.setExtraClasspath(classesPath.toAbsolutePath().toString());
+ Path apiClassesPath = apiBasePath.resolve("target/webapp/WEB-INF/classes");
+ apiContext.setExtraClasspath(apiClassesPath.toAbsolutePath().toString());
+
+ viewContext.setBaseResource(new PathResource(viewBasePath.resolve("src/main/webapp")));
+ // Add webapp compiled classes & resources (copied into place from src/main/resources)
+ Path viewClassesPath = viewBasePath.resolve("target/webapp/WEB-INF/classes");
+ viewContext.setExtraClasspath(viewClassesPath.toAbsolutePath().toString());
+
server.setDumpAfterStart(true);
break;
default:
throw new FileNotFoundException("Unable to configure WebAppContext base resource undefined");
}
-
- server.setHandler(context);
+
+ server.setHandler(new ContextHandlerCollection(apiContext, viewContext));
server.start();
server.join();
@@ -117,16 +136,19 @@ public class ServerMain
Path warPath = new File(warLocation).toPath().toRealPath();
if (Files.exists(warPath) && Files.isRegularFile(warPath))
{
- this.basePath = warPath;
+ this.apiBasePath = warPath;
+ this.viewBasePath = warPath;
return OperationalMode.PROD;
}
}
// We are in development mode, likely building and testing from an IDE.
- Path devPath = new File("../webapp").toPath().toRealPath();
- if (Files.exists(devPath) && Files.isDirectory(devPath))
+ Path apiDevPath = new File("../api-webapp").toPath().toRealPath();
+ Path viewDevPath = new File("../view-webapp").toPath().toRealPath();
+ if (Files.exists(apiDevPath) && Files.isDirectory(apiDevPath) && Files.exists(viewDevPath) && Files.isDirectory(viewDevPath))
{
- this.basePath = devPath;
+ this.apiBasePath = apiDevPath;
+ this.viewBasePath = viewDevPath;
return OperationalMode.DEV;
}
diff --git a/curl.sh b/curl.sh
index 96ba536..02ce12c 100755
--- a/curl.sh
+++ b/curl.sh
@@ -21,4 +21,4 @@ curl -s --header "Accept: application/json" http://localhost:8080/api/tour/1/par
echo
echo
-curl -s --header "Last-Event-Id: 0" http://localhost:8080/events
+curl -s --header "Last-Event-Id: 0" http://localhost:8080/api/events
diff --git a/pom.xml b/pom.xml
index bb154af..88720b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,8 @@
- webapp
+ api-webapp
+
container
bootstrap
application
diff --git a/webapp/src/main/config/jetty/jetty-env.xml b/webapp/src/main/config/jetty/jetty-env.xml
deleted file mode 100644
index 1f82f54..0000000
--- a/webapp/src/main/config/jetty/jetty-env.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/webapp/src/main/config/jetty/jetty-http.xml b/webapp/src/main/config/jetty/jetty-http.xml
deleted file mode 100644
index 49c6123..0000000
--- a/webapp/src/main/config/jetty/jetty-http.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webapp/src/main/config/jetty/jetty-https.xml b/webapp/src/main/config/jetty/jetty-https.xml
deleted file mode 100644
index 99abd18..0000000
--- a/webapp/src/main/config/jetty/jetty-https.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
- http/1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webapp/src/main/config/jetty/jetty-ssl-context.xml b/webapp/src/main/config/jetty/jetty-ssl-context.xml
deleted file mode 100644
index 121a644..0000000
--- a/webapp/src/main/config/jetty/jetty-ssl-context.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- true
- /
-
-
- /
-
-
-
-
-
-
-
-
-
diff --git a/webapp/src/main/config/jetty/jetty-ssl.xml b/webapp/src/main/config/jetty/jetty-ssl.xml
deleted file mode 100644
index 1ee1118..0000000
--- a/webapp/src/main/config/jetty/jetty-ssl.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/webapp/src/main/config/webapp.properties b/webapp/src/main/config/webapp.properties
deleted file mode 100644
index ed8aeee..0000000
--- a/webapp/src/main/config/webapp.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# webapp
-webapp.env = ${webapp.env}
-webapp.url = ${webapp.url}
-
-# smtp
-
-# Logging
-logger.level = ${logger.level}