//
// Copyright (C) 2025 veypi <i@veypi.com>
// 2025-03-04 16:08:06
// Distributed under terms of the MIT license.
//

package vbase

import (
	"embed"

	"github.com/veypi/vbase/api"
	"github.com/veypi/vhtml"
	vhtmlui "github.com/veypi/vhtml-ui"
	"github.com/veypi/vigo"
	"github.com/veypi/vigo/contrib/cors"
)

var Router = vigo.NewRouter()

//go:embed ui/*
var uifs embed.FS

func init() {
	Router.Extend("v", vhtmlui.Router)
	Router.Extend("api", api.Router)
	Router.SubRouter("/**").Use(cors.AllowAny)
	vhtml.WrapUI(Router, uifs)
}
