Browse Source

Configured Heroku deploy

pull/47/head
Kalle Stenflo 11 years ago
parent
commit
9686c6d0bc
  1. 2
      Procfile
  2. 3
      json-path-web-test/pom.xml
  3. 12
      json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java

2
Procfile

@ -1 +1 @@
web: java $JAVA_OPTS -Dserver.http.port=$PORT -jar web/build/distributions/trumpet-server-1.0.0-shadow.jar web: java $JAVA_OPTS -Dserver.http.port=$PORT -jar json-path-web-test/target/json-path-web-test-0.9.2-SNAPSHOT.one-jar.jar

3
json-path-web-test/pom.xml

@ -14,7 +14,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gatling-jsonpath.version>0.4.0</gatling-jsonpath.version> <gatling-jsonpath.version>0.4.0</gatling-jsonpath.version>
<boon.version>0.25</boon.version> <boon.version>0.25
</boon.version>
</properties> </properties>
<dependencies> <dependencies>

12
json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java

@ -13,6 +13,7 @@ import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer; import org.glassfish.jersey.servlet.ServletContainer;
import java.awt.*;
import java.io.IOException; import java.io.IOException;
@ -20,19 +21,16 @@ import java.io.IOException;
public class Main { public class Main {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
int port = 8080; String configPort = "8080";
if(args.length > 0){ if(args.length > 0){
try { configPort = args[0];
port = Integer.parseInt(args[0]);
} catch (NumberFormatException nfe) {
System.out.println("Invalid usage! Port argument must be an integer (if not supplied " + port + " is used)");
}
} }
String port = System.getProperty("server.http.port", configPort);
System.out.println("Server started on port: " + port); System.out.println("Server started on port: " + port);
Server server = new Server(); Server server = new Server();
server.setConnectors(new Connector[]{createConnector(server, port)}); server.setConnectors(new Connector[]{createConnector(server, Integer.parseInt(port))});
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
context.setContextPath("/api"); context.setContextPath("/api");

Loading…
Cancel
Save