This is a server that serves apis exposed by catalog module.
The api documentation is available at
To build this server from source, perform the following steps:
- Any POSIX or Windows environment (this was developed on a POSIX environment)
- JDK 1.8.0_144-b01
- git 2.9.2
- gradle 4.1
- postgres sql v 9.6.4 postgres should have a database created for use with catalog service
git clone https://github.com/alkuma/pricing-server.git gradle clean build #this will also run the unit tests. The war is generated in build/libs folder and is called pricing-server-1.0.0.war
Note : gradle clean build will also run the tests
- JRE 1.8
- tomcat 9.0.0.M26
- postgres sql v 9.6.4 postgres should have a database created for use with pricing service
To deploy, you must have a tomcat installation. In your tomcat installation create a folder catalog under webapps Unzip the generated war into this folder
-
cd /path/to/tomcat/webapps
-
mkdir -p pricing
-
cp /path/to/gradle/project/build/libs/*.war .
-
jar xf pricing-server-1.0.0.war
-
rm pricing-server-1.0.0.war
-
in /path/to/tomcat/webapps/catalog/WEB-INF/classes, there is a file called jdbc.properties. Populate the correct values of postgres hostname, postgres port, postgres database name, postgres user id, postgres password.
-
in /path/to/tomcat/webapps/catalog/WEB-INF/classes, there is a file called catalog-service.properties. Populate the correct values of where the service is hosted for client side service discovery
-
now you can start / stop tomcat using /path/to/tomcat/bin/shutdown.sh and /path/to/tomcat/bin/startup.sh By default tomcat will start on localhost:8080 but that can be changed by tweaking config scripts.
- a browser or any http client for making GET, POST and DELETE calls
- a running deployment (see above).
The endpoint will be prefixed with api, eg if tomcat is running at localhost:8080, the api url will be http://localhost:8080/pricing/api/pricing/ Refer to the api documentation above to run the tests on the running system.