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

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