diff --git a/Procfile b/Procfile new file mode 100644 index 000000000..c76133f5a --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: java $JAVA_OPTS -Ddw.server.connector.port=$PORT -jar luwak-server/target/luwak-server-1.5.0-SNAPSHOT.jar server luwak-server/heroku.yml \ No newline at end of file diff --git a/luwak-server/README.md b/luwak-server/README.md index 901bf789b..b490ce854 100644 --- a/luwak-server/README.md +++ b/luwak-server/README.md @@ -21,6 +21,10 @@ In `luwak-server`, Build the jar with `mvn package`, then run java -jar target/luwak-server-{version number here}-SNAPSHOT.jar +**UI** + +There is a basic UI accessible at `localhost:8080/ui` + **To add queries** Create a query input file in the following JSON format: @@ -36,3 +40,15 @@ Then run ```./load-queries ``` **To match a document against the service** ./match "This is the contents of my document" + +## Deploying to Heroku +Roughly following the instructions at https://devcenter.heroku.com/articles/getting-started-with-java#introduction +* Install the Heroku CLI +* If you have a public SSH key, you can upload it to Heroku + to make your life easier: `heroku keys:add ~/.ssh/id_rsa.pub` +* Create a Heroku app: `heroku create` +* Push your current branch to heroku: `git push heroku HEAD:master` +* Once that succeeds, start the app via: `heroku ps:scale web=1` +* Run `heroku open` to get the URL of the running application. You should be able to + to post to the API by appending the correct path, e.g. + `POST https://my-app-name.herokuapp.com/update` \ No newline at end of file diff --git a/luwak-server/heroku.yml b/luwak-server/heroku.yml new file mode 100644 index 000000000..22406b4dd --- /dev/null +++ b/luwak-server/heroku.yml @@ -0,0 +1,8 @@ +# This configuration is required to be able to allow Heroku to override the port via e.g. +# -Ddw.server.connector.port=$PORT +server: + type: simple + applicationContextPath: / + connector: + type: http + port: 8080 diff --git a/luwak-server/pom.xml b/luwak-server/pom.xml index 87c257ec4..c7086965d 100644 --- a/luwak-server/pom.xml +++ b/luwak-server/pom.xml @@ -10,6 +10,10 @@ 4.0.0 + + 1.0.5 + + luwak-server @@ -21,7 +25,12 @@ io.dropwizard dropwizard-core - 1.0.5 + ${dropwizard.version} + + + io.dropwizard + dropwizard-assets + ${dropwizard.version}