Skip to content

Commit

Permalink
fix static serve
Browse files Browse the repository at this point in the history
  • Loading branch information
TsotosA committed Feb 14, 2023
1 parent 839212a commit dcb7411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"embed"
"github.com/robfig/cron/v3"
"github.com/tsotosa/atmm/config"
"github.com/tsotosa/atmm/gconst"
Expand All @@ -18,6 +19,9 @@ var (
C = cron.New()
)

//go:embed web/ui-react/build/*
var static embed.FS

func main() {
config.ConfigInit(C, &mwg, GetCronJobs())

Expand Down
9 changes: 2 additions & 7 deletions web/ui-serve/ui-serve.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
package ui_serve

import (
"embed"
"fmt"
"github.com/labstack/echo/v4"
"github.com/tsotosa/atmm/config"
"io/fs"
)

//go:embed ../ui-react/build/*
var static embed.FS

func Up() {
e := echo.New()
_, _ = fs.Sub(static, "web/ui-react/build")
e.Static("/", "web/ui-react/build")
//_, _ = fs.Sub(static, "/web/ui-react/build")
e.Static("/", "/web/ui-react/build")
e.Logger.Fatal(e.Start(fmt.Sprintf(":%d", config.Conf.UiPort)))
}

0 comments on commit dcb7411

Please sign in to comment.