mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
26 lines
614 B
Go
26 lines
614 B
Go
package frontend
|
|
|
|
import (
|
|
"embed"
|
|
"net/http"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
"github.com/labstack/echo/v4/middleware"
|
|
)
|
|
|
|
//go:embed dist
|
|
var embeddedReactAssets embed.FS
|
|
|
|
func RegisterHandlers(e *echo.Echo) {
|
|
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
|
|
Skipper: nil,
|
|
// Root directory from where the static content is served.
|
|
Root: "dist",
|
|
// Enable HTML5 mode by forwarding all not-found requests to root so that
|
|
// SPA (single-page application) can handle the routing.
|
|
HTML5: true,
|
|
Browse: false,
|
|
IgnoreBase: false,
|
|
Filesystem: http.FS(embeddedReactAssets),
|
|
}))
|
|
}
|