From 5dea5a988d0e64fa6085c9bd3f2a9c976fcacdbf Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 19 Dec 2024 15:56:05 +0800 Subject: [PATCH] Add WAR file documentation --- README.md | 88 ++++++++++++++++++++----------------------------------- 1 file changed, 31 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 51ddd68..0ce31c8 100644 --- a/README.md +++ b/README.md @@ -1,91 +1,65 @@ -Aristotle -========= +Wilhelm Webservice +================== ![Java Version Badge][Java Version Badge] [![Apache License Badge]][Apache License, Version 2.0] -Aristotle is a [JSR 370] [JAX-RS] webservice of CRUD operations against a graph database. It supports Neo4J now. +__wilhelm-ws__ is a [JSR 370] [JAX-RS] webservice exclusively serving [wilhelmlang.com](https://wilhelmlang.com/) -Start Locally in Jetty ----------------------- +Development +----------- -Navigate to a dedicated directory; make sure port 8080 is not occupied and the following environment variables are set: +### Getting Source Code ```console -export NEO4J_URI= -export NEO4J_USERNAME= -export NEO4J_PASSWORD= -export NEO4J_DATABASE= +git@github.com:QubitPi/wilhelm-ws.git +cd wilhelm-ws ``` -Then start webservice with: +#### Running Tests -```bash -./jetty-start.sh +```console +mvn clean verify ``` -Press `Ctr-C` to stop the webservice and delete generated directories if needed when done. +### Generating WAR file -Test ----- +wilhelm-ws favors running in an external Jetty container, so its executable is not a fat JAR but a WAR which can be +compiled up with ```console -mvn clean verify +mvn clean package ``` -Deployment ----------- +### Starting Webservice Locally -At this moment deployment is manual and pretty much follows [jetty-start.sh](./jetty-start.sh) - -### Sending Logs to ELK Cloud +Navigate to a dedicated directory; make sure port 8080 is not occupied and the following environment variables are set: -Simply add Logstash integration and install agent on the production server. The logs will be available on integration -dashboard. +```console +export NEO4J_URI= +export NEO4J_USERNAME= +export NEO4J_PASSWORD= +export NEO4J_DATABASE= +``` -### Gateway Registration +Then start webservice with: ```bash -export GATEWAY_PUBLIC_IP= - -# vocabulary paged & count -curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ - --data name=wilhelm-ws-languages \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/neo4j/languages" -curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-languages/routes \ - --data "paths[]=/wilhelm/languages" \ - --data name=wilhelm-ws-languages - -# expand -curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ - --data name=wilhelm-ws-expand \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/neo4j/expand" -curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-expand/routes \ - --data "paths[]=/wilhelm/expand" \ - --data name=wilhelm-ws-expand - -# search -curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ - --data name=wilhelm-ws-search \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/neo4j/search" -curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-search/routes \ - --data "paths[]=/wilhelm/search" \ - --data name=wilhelm-ws-search +./jetty-start.sh ``` -We should see `HTTP/1.1 201 Created` as signs of success. +Press `Ctr-C` to stop the webservice and delete generated directories if needed when done. -#### Example requests +### Deployment -- vocabulary count: https://api.paion-data.dev/wilhelm/languages/german?perPage=100&page=1 -- query vocabulary paged: https://api.paion-data.dev/wilhelm/languages/german/count -- expand: https://api.paion-data.dev/wilhelm/expand/nämlich -- search: https://api.paion-data.dev/wilhelm/search/das +wilhelm-ws has a dedicated release definition called +[wilhelm-ws-release-definition](https://github.com/QubitPi/wilhelm-ws-release-definition) for its automated deployment. +Please check that our for details. License ------- -The use and distribution terms for [Aristotle]() are covered by the [Apache License, Version 2.0]. +The use and distribution terms for [wilhelm-ws]() are covered by the [Apache License, Version 2.0]. [Apache License Badge]: https://img.shields.io/badge/Apache%202.0-F25910.svg?style=for-the-badge&logo=Apache&logoColor=white [Apache License, Version 2.0]: https://www.apache.org/licenses/LICENSE-2.0