testFlow/init.go
Wyle.Gong-巩文昕 67b0ad2723 init
2025-04-22 16:42:48 +08:00

30 lines
535 B
Go

//
// Copyright (C) 2025 veypi <i@veypi.com>
// 2025-02-27 19:32:09
// Distributed under terms of the MIT license.
//
package app
import (
"app/api"
"embed"
"github.com/veypi/OneBD/rest"
"github.com/veypi/OneBD/rest/middlewares"
)
var Router = rest.NewRouter()
//go:embed ui/*
var uifs embed.FS
//go:embed ui/root.html
var rootFile []byte
var (
_ = Router.Extend("api", api.Router)
_ = Router.Get("/ui/*path", middlewares.EmbedDir(uifs, "ui", ""))
_ = Router.Get("/*path", middlewares.EmbedFile(rootFile, "text/html"))
)