diff --git a/pkg/internal/embed.go b/pkg/internal/embed.go deleted file mode 100644 index 38dd3ff..0000000 --- a/pkg/internal/embed.go +++ /dev/null @@ -1,6 +0,0 @@ -package pkg - -import "embed" - -//go:embed views/* -var FS embed.FS diff --git a/pkg/internal/server/api/index.go b/pkg/internal/server/api/index.go index e91d598..7704164 100644 --- a/pkg/internal/server/api/index.go +++ b/pkg/internal/server/api/index.go @@ -4,8 +4,8 @@ import ( "github.com/gofiber/fiber/v2" ) -func MapAPIs(app *fiber.App) { - api := app.Group("/api").Name("API") +func MapAPIs(app *fiber.App, baseURL string) { + api := app.Group(baseURL).Name("API") { api.Get("/users/me", getUserinfo) api.Get("/users/:accountId", getOthersInfo) diff --git a/pkg/internal/server/server.go b/pkg/internal/server/server.go index a35d8a1..fd9cba9 100644 --- a/pkg/internal/server/server.go +++ b/pkg/internal/server/server.go @@ -1,20 +1,16 @@ package server import ( - "git.solsynth.dev/hydrogen/messaging/pkg/internal" + "strings" + "git.solsynth.dev/hydrogen/messaging/pkg/internal/gap" "git.solsynth.dev/hydrogen/messaging/pkg/internal/server/api" "git.solsynth.dev/hydrogen/messaging/pkg/internal/server/exts" - "net/http" - "strings" - - "github.com/gofiber/fiber/v2/middleware/favicon" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/idempotency" "github.com/gofiber/fiber/v2/middleware/logger" - "github.com/gofiber/template/html/v2" jsoniter "github.com/json-iterator/go" "github.com/rs/zerolog/log" "github.com/spf13/viper" @@ -23,8 +19,6 @@ import ( var A *fiber.App func NewServer() { - templates := html.NewFileSystem(http.FS(pkg.FS), ".gohtml") - A = fiber.New(fiber.Config{ DisableStartupMessage: true, EnableIPValidation: true, @@ -35,8 +29,6 @@ func NewServer() { JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal, BodyLimit: 50 * 1024 * 1024, EnablePrintRoutes: viper.GetBool("debug.print_routes"), - Views: templates, - ViewsLayout: "views/index", }) A.Use(idempotency.New()) @@ -64,19 +56,7 @@ func NewServer() { A.Use(gap.H.AuthMiddleware) A.Use(exts.LinkAccountMiddleware) - A.Use(favicon.New(favicon.Config{ - FileSystem: http.FS(pkg.FS), - File: "views/favicon.png", - URL: "/favicon.png", - })) - - api.MapAPIs(A) - - A.Get("/", func(c *fiber.Ctx) error { - return c.Render("views/open", fiber.Map{ - "frontend": viper.GetString("frontend"), - }) - }) + api.MapAPIs(A, "/") } func Listen() { diff --git a/pkg/internal/views/favicon.png b/pkg/internal/views/favicon.png deleted file mode 100644 index 112fb34..0000000 Binary files a/pkg/internal/views/favicon.png and /dev/null differ diff --git a/pkg/internal/views/index.gohtml b/pkg/internal/views/index.gohtml deleted file mode 100644 index 68f74eb..0000000 --- a/pkg/internal/views/index.gohtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - Hydrogen.Interactive - - - - -{{embed}} - - \ No newline at end of file diff --git a/pkg/internal/views/open.gohtml b/pkg/internal/views/open.gohtml deleted file mode 100644 index 1cf5416..0000000 --- a/pkg/internal/views/open.gohtml +++ /dev/null @@ -1,60 +0,0 @@ -
-
- Icon - -

Launching Solian... 🚀

-

- Hold on a second...
- We are redirecting you to our application... -

-
-
- - - - \ No newline at end of file