mirror of https://github.com/veypi/OneAuth.git
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.
36 lines
582 B
Go
36 lines
582 B
Go
|
7 months ago
|
//
|
||
|
|
// main.go
|
||
|
|
// Copyright (C) 2024 veypi <i@veypi.com>
|
||
|
|
// 2025-03-04 16:08:06
|
||
|
|
// Distributed under terms of the MIT license.
|
||
|
|
//
|
||
|
|
|
||
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
app "oa"
|
||
|
|
"oa/cfg"
|
||
|
|
|
||
|
|
"github.com/veypi/OneBD/rest"
|
||
|
|
"github.com/veypi/utils/logv"
|
||
|
|
)
|
||
|
|
|
||
|
|
func main() {
|
||
|
|
CMD.Command = runWeb
|
||
|
|
CMD.Parse()
|
||
|
|
err := CMD.Run()
|
||
|
|
if err != nil {
|
||
|
|
logv.Warn().Msg(err.Error())
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func runWeb() error {
|
||
|
|
server, err := rest.New(rest.WithHost(cfg.Config.Host), rest.WithPort(cfg.Config.Port))
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
server.SetRouter(app.Router)
|
||
|
|
server.Router().Print()
|
||
|
|
return server.Run()
|
||
|
|
}
|