404 now redirects to home page.

This commit is contained in:
NovaFox161
2018-01-11 07:36:55 -06:00
parent ce6ded04a2
commit 541acf7fc4
2 changed files with 6 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ public class ApplicationHandler {
Main.client.logout();
} catch (DiscordException e) {
//No need to print, exiting anyway.
e.printStackTrace();
}
TimeManager.getManager().shutdown();
DatabaseManager.getManager().disconnectFromMySQL();

View File

@@ -22,6 +22,11 @@ public class SparkUtils {
staticFileLocation("/web/public"); // Main site location
notFound(((request, response) -> {
response.redirect("/");
return response.body();
}));
//Register the API Endpoints
before("/api/*", (request, response) -> {
if (!request.requestMethod().equalsIgnoreCase("POST")) {