|
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). |
| 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 | 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 | 6 |
|
7 | | -[Binary WAR file](https://github.com/SP7-Ritmare/EDI-NG_server/releases/download/v1.0/edi.war) is available via the "releases" tab. |
| 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 | 8 | The WAR has been tested on Tomcat 7. |
9 | 9 |
|
10 | | -> You will probably not need the pre-packaged WAR, anyway, because it points to our own installation of the PostgreSQL database. |
11 | | -> You should edit your copy (https://github.com/SP7-Ritmare/EDI-NG_server/blob/master/EDI-T/src/main/resources/application.properties) file and change the spring.datasource.* entries to point to your own PostgreSQL installation. |
12 | | -> **Warning**: deploying the WAR file will create all necessary tables, but it WILL NOT create the database. |
| 10 | +> The pre-packaged WAR file can be a good starting point to test the system in a reasonably "standalone" mode. |
13 | 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 |
| 25 | +``` |
| 26 | + |
| 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. |
| 28 | + |
| 29 | +## Building your own WAR file |
14 | 30 | 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: |
15 | 31 | ```bash |
16 | 32 | mvn package |
17 | 33 | ``` |
18 | 34 | This will create your WAR file in the target directory, ready for deployment. |
19 | 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. |
| 37 | + |
20 | 38 | # Dependencies |
21 | 39 | All dependencies are listed in the *pom.xml* file. |
22 | 40 |
|
|
0 commit comments