You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/init.go

40 lines
691 B
Go

//
// 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/vbase/auth"
"github.com/veypi/vbase/cfg"
"github.com/veypi/vbase/models"
"github.com/veypi/vhtml"
vhtmlui "github.com/veypi/vhtml-ui"
"github.com/veypi/vigo"
)
var Router = vigo.NewRouter()
var (
NewAuth = auth.Factory.New
Config = cfg.Global
)
func Init() error {
return models.Migrate()
}
//go:embed ui
var uifs embed.FS
func init() {
Router.Extend("/api", api.Router)
Router.Extend("v", vhtmlui.Router)
Router.Extend("vhtml", vhtml.Router)
vhtml.WrapUI(Router, uifs)
}