Introducing API Level

This commit is contained in:
LittleSheep 2024-11-13 22:26:54 +08:00
parent f7d82bc93a
commit c0edeec621
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package api package api
import ( import (
pkg "git.solsynth.dev/hypernet/nexus/pkg/internal"
"git.solsynth.dev/hypernet/nexus/pkg/internal/auth" "git.solsynth.dev/hypernet/nexus/pkg/internal/auth"
"git.solsynth.dev/hypernet/nexus/pkg/internal/http/ws" "git.solsynth.dev/hypernet/nexus/pkg/internal/http/ws"
"github.com/gofiber/contrib/websocket" "github.com/gofiber/contrib/websocket"
@ -12,7 +13,11 @@ func MapAPIs(app *fiber.App) {
wellKnown := app.Group("/.well-known").Name("Well Known") wellKnown := app.Group("/.well-known").Name("Well Known")
{ {
wellKnown.Get("/", func(c *fiber.Ctx) error { wellKnown.Get("/", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK) return c.JSON(fiber.Map{
"api_level": pkg.ApiLevel,
"version": pkg.AppVersion,
"status": true,
})
}) })
wellKnown.Get("/check-ip", getClientIP) wellKnown.Get("/check-ip", getClientIP)
wellKnown.Get("/directory/services", listExistsService) wellKnown.Get("/directory/services", listExistsService)

View File

@ -2,4 +2,5 @@ package pkg
const ( const (
AppVersion = "1.0.0" AppVersion = "1.0.0"
ApiLevel = 10
) )