altered start url

This commit is contained in:
Stephan Richter
2021-04-26 15:18:23 +02:00
parent e52c5522e4
commit acb23d4434
2 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>1.4.27</version>
<version>1.4.28</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

View File

@@ -63,7 +63,8 @@ public class Application extends BaseClass{
InetSocketAddress addr = new InetSocketAddress(config.getOrAdd(PORT, 8080));
String planName = config.getOrAdd(Plan.NAME, Plan.DEFAULT_NAME);
HttpServer server = HttpServer.create(addr, 0);
server.createContext("/plan", client -> sendPlan(client));
server.createContext("/", client -> sendPlan(client));
server.createContext("/plan", client -> sendPlan(client)); // backward compatibility
server.createContext("/css" , client -> sendFile(client));
server.createContext("/js" , client -> sendFile(client));
server.createContext("/stream", client -> stream(client));
@@ -75,7 +76,7 @@ public class Application extends BaseClass{
}
plan.setAppConfig(config);
try {
Desktop.getDesktop().browse(URI.create("http://"+InetAddress.getLocalHost().getHostName()+":"+config.getInt(PORT)+"/plan"));
Desktop.getDesktop().browse(URI.create("http://"+InetAddress.getLocalHost().getHostName()+":"+config.getInt(PORT)));
} catch (IOException e) {
e.printStackTrace();
}