|
1 | 1 | # EDI-NG_server |
2 | 2 | This is the server side for [SP7-Ritmare/EDI-NG_client](https://github.com/SP7-Ritmare/EDI-NG_client). |
3 | 3 |
|
4 | | -It's a [Spring](http://spring.io) Boot application configured to package as a WAR file, so as to allow deployment to, e.g., [Tomcat](http://tomcat.apache.org), relying on a [PostgreSQL](https://www.postgresql.org) database server. |
5 | | -In order to deploy to Tomcat, you need to place the WAR file in Tomcat's webapps directory, or upload it via the Tomcat manager application. |
6 | | - |
7 | | -A [Binary WAR file](https://github.com/SP7-Ritmare/EDI-NG_server/releases/download/v1.0/edi.war) is available via the "releases" tab. |
8 | | -The WAR has been tested on Tomcat 7. |
9 | | - |
10 | | -> The pre-packaged WAR file can be a good starting point to test the system in a reasonably "standalone" mode. |
11 | | -
|
12 | | -> It contains a built-in version of EDI-NG_client where the templates point to the EDI-NG_server packaged within, with the following pre-requisites: |
13 | | -> * Tomcat should run on port 8080 |
14 | | -> * PostgreSQL must be installed on a host reachable from your Tomcat machine |
15 | | -> * An empty database must be created in the PostgreSQL server |
16 | | -> * Once deployed, you'll need to change the application.war file, present in your Tomcat host's $TOMCAT_HOME/webapps/edi/WEB-INF/classes/ directory, and then restart Tomcat |
17 | | -> |
18 | | -
|
19 | | -Following is an example of the configuration you need to edit in $TOMCAT_HOME/webapps/edi/WEB-INF/classes/application.properties |
20 | | -```properties |
21 | | -spring.datasource.url=jdbc:postgresql://<your PostreSQL host>/<db name you picked> |
22 | | -spring.datasource.username=<username> |
23 | | -spring.datasource.password=<password> |
24 | | -spring.datasource.driverClassName=org.postgresql.Driver |
| 4 | +It's a [Spring](http://spring.io) Boot application configured to package as a JAR file, relying on any [JPA](https://en.wikipedia.org/wiki/Java_Persistence_API) database connector, e.g. one to a [PostgreSQL](https://www.postgresql.org) database server. |
| 5 | + |
| 6 | +A [demo JAR file](https://github.com/SP7-Ritmare/EDI-NG_server/releases/download/v1.0/edi.war) is available in the [demo](https://github.com/SP7-Ritmare/EDI-NG_server/tree/master/demo) directory. |
| 7 | + |
| 8 | +> The pre-packaged JAR file can be a good starting point to test the system in a "standalone" mode. |
| 9 | +
|
| 10 | +> It contains a built-in version of EDI-NG_client where the templates point to the EDI-NG_server packaged within. |
| 11 | +
|
| 12 | +> **WARNING!** Demo configuration uses the [H2 in-memory database](http://www.h2database.com/html/main.html) so as to simplify EDI's configuration. **As it is an in-memory database, data won't survive a restart of the application**. |
| 13 | +
|
| 14 | +All you need to do is open a terminal, go to the demo directory you downloaded, and run |
| 15 | + |
| 16 | +```bash |
| 17 | +./edi.sh |
25 | 18 | ``` |
26 | 19 |
|
27 | | -Once all prerequisites are met, you can test the EDI-NG_client and server by pointing your browser to http://localhost:8080/ on your Tomcat machine. |
| 20 | +Then just point your browser to http://localhost:8080/ |
28 | 21 |
|
29 | | -## Building your own WAR file |
| 22 | +## Building your own JAR file |
30 | 23 | If you want to build the latest release from sources, you can user [Apache Maven](https://maven.apache.org/index.html) (Apache License v2.0). In the EDI-T directory, simply run: |
31 | 24 | ```bash |
32 | 25 | mvn package |
33 | 26 | ``` |
34 | | -This will create your WAR file in the target directory, ready for deployment. |
| 27 | +This will create your JAR file in the target directory, ready for deployment. |
| 28 | + |
| 29 | +As an alternative, you can go to the "demo" directory and run: |
| 30 | +```bash |
| 31 | +./create_demo.sh |
| 32 | +``` |
| 33 | + |
| 34 | +This will update the JAR in the demo directory and launch it with the local application.properties file as a configuration. |
35 | 35 |
|
36 | | -Prior to create the WAR file you might want to customise the application.properties file, mentioned above, so as to match your PostgreSQL location. |
| 36 | +Prior to creating the JAR file you might want to customise the application.properties file, mentioned above, so as to match your database desired location. |
37 | 37 |
|
38 | 38 | # Dependencies |
39 | 39 | All dependencies are listed in the *pom.xml* file. |
|
0 commit comments