diff --git a/src/main/java/dev/plex/HTTPDModule.java b/src/main/java/dev/plex/HTTPDModule.java index 07a3b47..31d76ab 100644 --- a/src/main/java/dev/plex/HTTPDModule.java +++ b/src/main/java/dev/plex/HTTPDModule.java @@ -8,6 +8,7 @@ import dev.plex.request.impl.IndexEndpoint; import dev.plex.request.impl.ListEndpoint; import dev.plex.request.impl.PunishmentsEndpoint; import dev.plex.request.impl.SchematicDownloadEndpoint; +import dev.plex.request.impl.SchematicIndexEndpoint; import dev.plex.util.PlexLog; import java.util.concurrent.atomic.AtomicReference; import lombok.Getter; @@ -69,6 +70,7 @@ public class HTTPDModule extends PlexModule new ListEndpoint(); new PunishmentsEndpoint(); new SchematicDownloadEndpoint(); + new SchematicIndexEndpoint(); server.setConnectors(new Connector[]{connector}); server.setHandler(context); diff --git a/src/main/java/dev/plex/request/impl/SchematicIndexEndpoint.java b/src/main/java/dev/plex/request/impl/SchematicIndexEndpoint.java index df1c2d6..4cbad89 100644 --- a/src/main/java/dev/plex/request/impl/SchematicIndexEndpoint.java +++ b/src/main/java/dev/plex/request/impl/SchematicIndexEndpoint.java @@ -1,16 +1,14 @@ package dev.plex.request.impl; -import com.google.gson.GsonBuilder; import dev.plex.request.AbstractServlet; import dev.plex.request.GetMapping; import jakarta.servlet.http.HttpServletRequest; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; public class SchematicIndexEndpoint extends AbstractServlet { - @GetMapping(endpoint = "/api/list/") + @GetMapping(endpoint = "/api/schematics/") public String schematicIndex(HttpServletRequest request) { + return readFile(this.getClass().getResourceAsStream("/httpd/schematic_list.html")); } } diff --git a/src/main/resources/httpd/schematic_list.html b/src/main/resources/httpd/schematic_list.html index d524643..02ae86e 100644 --- a/src/main/resources/httpd/schematic_list.html +++ b/src/main/resources/httpd/schematic_list.html @@ -45,8 +45,8 @@

Plex HTTPD

Welcome to the schematic page. Please select if you would like to download or upload a schematic.
- - + +