Add ping route
This commit is contained in:
parent
5cc9492a00
commit
69b433def8
@ -8,11 +8,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
app.Get("/ping", PingHandler)
|
||||||
app.Get("/status/java/:address", JavaStatusHandler)
|
app.Get("/status/java/:address", JavaStatusHandler)
|
||||||
app.Get("/status/bedrock/:address", BedrockStatusHandler)
|
app.Get("/status/bedrock/:address", BedrockStatusHandler)
|
||||||
app.Get("/icon/:address", IconHandler)
|
app.Get("/icon/:address", IconHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PingHandler(ctx *fiber.Ctx) error {
|
||||||
|
return ctx.SendStatus(http.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
func JavaStatusHandler(ctx *fiber.Ctx) error {
|
func JavaStatusHandler(ctx *fiber.Ctx) error {
|
||||||
host, port, err := ParseAddress(ctx.Params("address"), 25565)
|
host, port, err := ParseAddress(ctx.Params("address"), 25565)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user