diff --git a/java/lc-esp-eo-engine/src/main/java/lc/esp/eo/EOTransaction.java b/java/lc-esp-eo-engine/src/main/java/lc/esp/eo/EOTransaction.java index 41b3a03d6b6b7d20d6a0deb9e64fc78412230c31..2cb30b293633939f20e528e5204bca0f274b3d07 100644 --- a/java/lc-esp-eo-engine/src/main/java/lc/esp/eo/EOTransaction.java +++ b/java/lc-esp-eo-engine/src/main/java/lc/esp/eo/EOTransaction.java @@ -492,6 +492,7 @@ public class EOTransaction implements AutoCloseable { EOId lastId = parentId; Path p = Path.of(path); + // FIXME: Need to check if these are duplicate entries (or get an index?) for (Path part : p) { EOId newId = objAdd(TYPE_INODE); if (bottomDirectory == null) bottomDirectory = newId; diff --git a/java/lc-esp-viewpoint-service/build.gradle b/java/lc-esp-viewpoint-service/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..b99d4eb590e4405fa8bf4ebce798dbfa22c3a76d --- /dev/null +++ b/java/lc-esp-viewpoint-service/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'java' +} + +version = '20.0-SNAPSHOT' + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lc-esp-eo-engine') + implementation project(':lc-esp-engine') + testImplementation platform('org.junit:junit-bom:5.9.1') + testImplementation 'org.junit.jupiter:junit-jupiter' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/java/lc-esp-viewpoint-service/src/main/java/lc/esp/viewpoint/service/ViewpointService.java b/java/lc-esp-viewpoint-service/src/main/java/lc/esp/viewpoint/service/ViewpointService.java new file mode 100644 index 0000000000000000000000000000000000000000..f5901f294c87d45b992dbb0a505be4f2f253785d --- /dev/null +++ b/java/lc-esp-viewpoint-service/src/main/java/lc/esp/viewpoint/service/ViewpointService.java @@ -0,0 +1,22 @@ +package lc.esp.viewpoint.service; + +import lc.esp.engine.ESPEngine; +import lc.mecha.fabric.HandlerStatus; +import lc.mecha.http.server.HttpTransaction; +import lc.mecha.http.server.PrefixedHandler; + +import java.util.Set; + +public class ViewpointService { + public static void main(String[] args) throws Exception { + ESPEngine esp = new ESPEngine(); + esp.register(new PrefixedHandler(Set.of("/api/example")) { + @Override + public HandlerStatus handlePrefixedWebRequest(HttpTransaction request) throws Throwable { + request.httpServletResponse.getOutputStream().write("Hello World\n".getBytes()); + return HandlerStatus.BREAK; + } + }); + esp.runDangerously(); + } +} diff --git a/java/settings.gradle b/java/settings.gradle index bbb5edcb5d624f304f18f57aba48394eb2027d08..fd9f0198405dd015e25d978350b7b37f523adebd 100644 --- a/java/settings.gradle +++ b/java/settings.gradle @@ -30,4 +30,5 @@ include 'lc-esp-engine' include 'lc-esp-example-service' include 'lc-esp-script-engine' include 'lc-esp-eo-service' +include 'lc-esp-viewpoint-service'