This project contains three services:
quotes
which serves a random quote fromquotes/resources/quotes.json
newsfeed
which aggregates several RSS feeds togetherfront-end
which calls the two previous services and displays the results.
- Java
- Leiningen (can be installed using
brew install leiningen
)
You can run the tests of all apps by using make test
First you need to ensure that the common libraries are installed: run make libs
to install them to your local ~/.m2
repository. This will allow you to build the JARs.
To build all the JARs and generate the static t
691C
arball, run the make clean all
command from this directory. The JARs and tarball will appear in the build/
directory.
cd
to front-end/public
and run ./serve.py
(you need Python3 installed). This will serve the assets on port 8000.
All the apps take environment variables to configure them and expose the URL /ping
which will just return a 200 response that you can use with e.g. a load balancer to check if the app is running.
java -jar front-end.jar
Environment variables:
APP_PORT
: The port on which to run the appSTATIC_URL
: The URL on which to find the static assetsQUOTE_SERVICE_URL
: The URL on which to find the quote serviceNEWSFEED_SERVICE_URL
: The URL on which to find the newsfeed serviceNEWSFEED_SERVICE_TOKEN
: The authentication token that allows the app to talk to the newsfeed service. This should be treated as an application secret. The value should be:T1&eWbYXNWG1w1^YGKDPxAWJ@^et^&kX
java -jar quotes.jar
Environment variables
APP_PORT
: The port on which to run the app
java -jar newsfeed.jar
Environment variables
APP_PORT
: The port on which to run the app