embed fs
This commit is contained in:
parent
d7b644c491
commit
540a4a6a00
@ -2,9 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
wizard_vue "github.com/egor3f/rssalchemy/frontend/wizard-vue"
|
||||||
"github.com/egor3f/rssalchemy/internal/adapters/natsadapter"
|
"github.com/egor3f/rssalchemy/internal/adapters/natsadapter"
|
||||||
|
httpApi "github.com/egor3f/rssalchemy/internal/api/http"
|
||||||
"github.com/egor3f/rssalchemy/internal/config"
|
"github.com/egor3f/rssalchemy/internal/config"
|
||||||
httpApi "github.com/egor3f/rssalchemy/internal/delivery/http"
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/labstack/echo/v4/middleware"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
"github.com/labstack/gommon/log"
|
"github.com/labstack/gommon/log"
|
||||||
@ -47,7 +48,8 @@ func main() {
|
|||||||
e := echo.New()
|
e := echo.New()
|
||||||
e.Use(middleware.Logger())
|
e.Use(middleware.Logger())
|
||||||
e.Use(middleware.Recover())
|
e.Use(middleware.Recover())
|
||||||
e.Static("/", "frontend/wizard")
|
|
||||||
|
e.StaticFS("/", echo.MustSubFS(wizard_vue.EmbedFS, wizard_vue.FSPrefix))
|
||||||
|
|
||||||
apiHandler := httpApi.New(cq)
|
apiHandler := httpApi.New(cq)
|
||||||
apiHandler.SetupRoutes(e.Group("/api/v1"))
|
apiHandler.SetupRoutes(e.Group("/api/v1"))
|
||||||
|
|||||||
8
frontend/wizard-vue/embed.go
Normal file
8
frontend/wizard-vue/embed.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package wizard_vue
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed dist
|
||||||
|
var EmbedFS embed.FS
|
||||||
|
|
||||||
|
const FSPrefix = "dist"
|
||||||
@ -4,7 +4,7 @@ import {getCurrentInstance, onMounted, useTemplateRef} from "vue";
|
|||||||
|
|
||||||
const {field, focused} = defineProps<{
|
const {field, focused} = defineProps<{
|
||||||
field: Field,
|
field: Field,
|
||||||
focused: boolean,
|
focused?: boolean,
|
||||||
}>();
|
}>();
|
||||||
const id = 'field' + getCurrentInstance()?.uid;
|
const id = 'field' + getCurrentInstance()?.uid;
|
||||||
const model = defineModel();
|
const model = defineModel();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user