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

42 lines
719 B
Go

12 months ago
//
// Copyright (C) 2025 veypi <i@veypi.com>
// 2025-03-04 16:08:06
// Distributed under terms of the MIT license.
//
1 month ago
package vbase
12 months ago
import (
1 month ago
"embed"
1 month ago
"github.com/veypi/vbase/api"
1 month ago
"github.com/veypi/vbase/auth"
1 month ago
"github.com/veypi/vbase/cfg"
"github.com/veypi/vbase/models"
1 month ago
"github.com/veypi/vhtml"
vhtmlui "github.com/veypi/vhtml-ui"
1 month ago
"github.com/veypi/vigo"
12 months ago
)
var Router = vigo.NewRouter()
1 month ago
var (
NewAuth = auth.Factory.New
Config = cfg.Global
1 month ago
)
type Options = cfg.Options
func Init() error {
return models.Migrate()
}
1 month ago
//go:embed ui
var uifs embed.FS
1 month ago
func init() {
Router.Extend("/api", api.Router)
1 month ago
Router.Extend("v", vhtmlui.Router)
Router.Extend("vhtml", vhtml.Router)
vhtml.WrapUI(Router, uifs)
}