diff --git a/src/de/steamwar/bungeecore/api/WebAPI.java b/src/de/steamwar/bungeecore/api/WebAPI.java index 1f06ebac..4901a0c3 100644 --- a/src/de/steamwar/bungeecore/api/WebAPI.java +++ b/src/de/steamwar/bungeecore/api/WebAPI.java @@ -23,8 +23,8 @@ import com.google.gson.JsonObject; import de.steamwar.bungeecore.api.v1.ServerstatusEndPoint; import de.steamwar.bungeecore.api.v1.ServerteamEndPoint; import de.steamwar.bungeecore.api.v1.statistics.*; -import de.steamwar.bungeecore.api.v1.user.GetUuidEndPoint; import de.steamwar.bungeecore.api.v1.user.GetUsernameEndPoint; +import de.steamwar.bungeecore.api.v1.user.GetUuidEndPoint; import de.steamwar.bungeecore.api.v1.website.LoginEndPoint; import de.steamwar.bungeecore.api.v1.website.LogoutEndPoint; @@ -33,7 +33,7 @@ import static spark.Spark.post; public class WebAPI { - private static EndPoint[] endPoints = new EndPoint[] { + private static EndPoint[] endPointsV1 = new EndPoint[] { new FightsEndPoint(), new HoursContributedEndPoint(), new HoursPlayedEndPoint(), @@ -47,9 +47,7 @@ public class WebAPI { new ServerteamEndPoint(), }; - public static void start() { - port(1024); - + private static void register(EndPoint[] endPoints) { for (EndPoint endPoint : endPoints) { post(endPoint.path(), (request, response) -> { JsonObject result = endPoint.result(request, response); @@ -61,4 +59,10 @@ public class WebAPI { }); } } + + public static void start() { + port(1024); + + register(endPointsV1); + } }