From a9e03b481c6b500c353a99efce40336326c4e26c Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Sat, 31 Dec 2016 02:09:20 -0500 Subject: [PATCH] Add Heroku support --- Procfile | 1 + pom.xml | 12 +++++++++++- server/pom.xml | 11 +++++++++++ server/src/main/java/lingo/server/LingoServer.java | 7 +++++++ system.properties | 1 + 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 system.properties diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..555b9c0 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: java -jar server/target/lingo-websocket-server.jar diff --git a/pom.xml b/pom.xml index 829057d..bc342cf 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,20 @@ - client client-api common server + + + + + javafx + + client + + + + diff --git a/server/pom.xml b/server/pom.xml index 9460bb1..a4becfb 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -46,6 +46,17 @@ src/main/config + + + + + repackage + + + ${project.artifactId} + + + diff --git a/server/src/main/java/lingo/server/LingoServer.java b/server/src/main/java/lingo/server/LingoServer.java index acc8713..4337da0 100644 --- a/server/src/main/java/lingo/server/LingoServer.java +++ b/server/src/main/java/lingo/server/LingoServer.java @@ -7,6 +7,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class LingoServer { public static void main(String[] args) { + + // Heroku dynamically assigns a port + final String webPort = System.getenv("PORT"); + if (webPort != null && !webPort.isEmpty()) { + System.setProperty("server.port", webPort); + } + SpringApplication.run(LingoServer.class, args); } diff --git a/system.properties b/system.properties new file mode 100644 index 0000000..5e8606c --- /dev/null +++ b/system.properties @@ -0,0 +1 @@ +java.runtime.version=1.8