mirror of
https://github.com/luscis/openlan.git
synced 2025-09-26 20:41:29 +08:00
28 lines
516 B
Go
Executable File
28 lines
516 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/luscis/openlan/cmd/api"
|
|
"github.com/luscis/openlan/cmd/api/v5"
|
|
)
|
|
|
|
func main() {
|
|
api.Version = api.GetEnv("VERSION", api.Version)
|
|
api.Url = api.GetEnv("URL", api.Url)
|
|
api.Token = api.GetEnv("TOKEN", api.Token)
|
|
api.Server = api.GetEnv("CONFSERVER", api.Server)
|
|
api.Database = api.GetEnv("DATABASE", api.Database)
|
|
app := &api.App{}
|
|
app.New()
|
|
|
|
switch api.Version {
|
|
default:
|
|
v5.Commands(app)
|
|
}
|
|
if err := app.Run(os.Args); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|