diff --git a/.idea/misc.xml b/.idea/misc.xml index 5cd2caa..6619eb6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/src/java/com/wasteinformationserver/main.java b/src/java/com/wasteinformationserver/main.java index 86bb305..a886d6b 100644 --- a/src/java/com/wasteinformationserver/main.java +++ b/src/java/com/wasteinformationserver/main.java @@ -11,7 +11,7 @@ import java.io.IOException; public class main { public static void main(String[] args) { - Log.setLevel(Log.DEBUG); + Log.setLevel(Log.INFO); Log.info("startup of WasteInformationServer"); diff --git a/src/java/com/wasteinformationserver/website/Webserver.java b/src/java/com/wasteinformationserver/website/Webserver.java index 3c8e3e4..6551af8 100644 --- a/src/java/com/wasteinformationserver/website/Webserver.java +++ b/src/java/com/wasteinformationserver/website/Webserver.java @@ -10,6 +10,7 @@ import com.wasteinformationserver.website.datarequests.login.CheckLoginState; import com.wasteinformationserver.website.datarequests.login.LoginRequest; import java.io.IOException; +import java.net.BindException; import java.net.InetSocketAddress; @@ -19,23 +20,27 @@ public class Webserver { HttpServer server = null; try { server = HttpServer.create(new InetSocketAddress(8000), 0); + + server.createContext("/", new MainPage()); + + server.createContext("/senddata/loginget", new LoginRequest()); + server.createContext("/senddata/registerpost", new RegisterRequest()); + server.createContext("/senddata/checkloginstate", new CheckLoginState()); + server.createContext("/senddata/wastedata", new DataRequest()); + server.createContext("/senddata/admindata", new AdminRequests()); + server.createContext("/senddata/newdate", new NewDateRequest()); + + server.setExecutor(null); // creates a default executor + server.start(); + Log.info("Server available at http://127.0.0.1:8000 now"); + }catch (BindException e){ + Log.criticalerror("The Port 8000 is already in use!"); } catch (IOException e) { e.printStackTrace(); } - server.createContext("/", new MainPage()); - server.createContext("/senddata/loginget", new LoginRequest()); - server.createContext("/senddata/registerpost", new RegisterRequest()); - server.createContext("/senddata/checkloginstate", new CheckLoginState()); - server.createContext("/senddata/wastedata", new DataRequest()); - server.createContext("/senddata/admindata", new AdminRequests()); - server.createContext("/senddata/newdate", new NewDateRequest()); - - server.setExecutor(null); // creates a default executor - server.start(); - Log.info("Server available at http://127.0.0.1:8000 now"); /* diff --git a/src/resources/wwwroot/dashboard.html b/src/resources/wwwroot/dashboard.html index 19c0ab4..f86d109 100644 --- a/src/resources/wwwroot/dashboard.html +++ b/src/resources/wwwroot/dashboard.html @@ -37,6 +37,8 @@ + + diff --git a/src/resources/wwwroot/wasteicon.png b/src/resources/wwwroot/favicon.png similarity index 100% rename from src/resources/wwwroot/wasteicon.png rename to src/resources/wwwroot/favicon.png diff --git a/src/resources/wwwroot/manifest.json b/src/resources/wwwroot/manifest.json index 51336ae..f622345 100644 --- a/src/resources/wwwroot/manifest.json +++ b/src/resources/wwwroot/manifest.json @@ -7,7 +7,7 @@ "description": "A web app to manage waste pickups", "icons": [ { - "src": "wasteicon.png", + "src": "favicon.png", "sizes": "512x512", "type": "image/png" } diff --git a/src/resources/wwwroot/sw.js b/src/resources/wwwroot/sw.js index 3a3a004..7c17431 100644 --- a/src/resources/wwwroot/sw.js +++ b/src/resources/wwwroot/sw.js @@ -10,7 +10,7 @@ const staticAssets = [ '/lib/jquery.min.js', '/lib/popper.min.js', '/rsc/login2.jpg', - '/wasteicon.png' + '/favicon.png' ]; self.addEventListener('install', async e => {