Skip to content

Commit

Permalink
optional argumet to specify server port
Browse files Browse the repository at this point in the history
  • Loading branch information
wissenbach committed Apr 7, 2017
1 parent d3110be commit 4294590
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<upload.url>beta.faustedition.net:/var/www/dev</upload.url>
<faust.diplo.allowedFailures>10</faust.diplo.allowedFailures>
<faust.diplo.server>false</faust.diplo.server> <!-- Run only the web server, don't actually convert -->
<faust.diplo.port>62436</faust.diplo.port> <!-- Run only the web server, don't actually convert -->
<faust.diplo.port>0</faust.diplo.port> <!-- Specify port for server, default to auto -->
<faust.diplo.debug>false</faust.diplo.debug> <!-- Debug phantomjs, produces massive output -->
<exist.app-name>faust-dev</exist.app-name>
</properties>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/faustedition/gen/DiplomaticConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ public static void main(final String[] args) throws IOException {
System.setProperty("java.util.logging.SimpleFormatter.format", "%4$s: %5$s%n");
onlyWebServer = Boolean.valueOf((String) properties.getOrDefault("faust.diplo.server", "false"));
debugPhantomJS = Boolean.valueOf((String) properties.getOrDefault("faust.diplo.debug", "false"));
final SimpleWebServer webServer = new SimpleWebServer("localhost", 0, new File("svg_rendering/page"), true);
final int listeningPort = Integer.valueOf((String) properties.getOrDefault("faust.diplo.port", "0"));
final SimpleWebServer webServer = new SimpleWebServer("localhost", listeningPort, new File("svg_rendering/page"), true);
webServer.start(60, true);
try {
final int listeningPort = Integer.valueOf((String) properties.getOrDefault("faust.diplo.port", Integer.toString(webServer.getListeningPort())));
serverURL = new URL("http", "localhost", listeningPort, "/transcript-generation.html").toString();
serverURL = new URL("http", "localhost", webServer.getListeningPort(), "/transcript-generation.html").toString();
logger.info(MessageFormat.format("Web server runs on {0}", serverURL));
baseCmdLine = ImmutableList.of(
System.getProperty("phantomjs.binary", "/usr/local/bin/phantomjs"),
Expand Down

0 comments on commit 4294590

Please sign in to comment.