Skip to content

Commit

Permalink
Added the /ping route
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmyt committed Jul 31, 2021
1 parent 007987b commit 056bb62
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/java/de/gnmyt/mcdash/panel/routes/PingRoute.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package de.gnmyt.mcdash.panel.routes;

import de.gnmyt.mcdash.api.handler.DefaultHandler;
import de.gnmyt.mcdash.api.http.Request;
import de.gnmyt.mcdash.api.http.ResponseController;

public class PingRoute extends DefaultHandler {

@Override
public String path() {
return "ping";
}

/**
* Simple ping route
* @param request The request object from the HttpExchange
* @param response The Response controller from the HttpExchange
*/
@Override
public void get(Request request, ResponseController response) {
response.text("Pong!");
}

}

0 comments on commit 056bb62

Please sign in to comment.