mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: new command line options
This commit is contained in:
parent
4e6b2daf0d
commit
4239a89d66
4 changed files with 53 additions and 8 deletions
15
main.go
15
main.go
|
@ -1,22 +1,23 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/internal/cmd"
|
||||
"github.com/0xJacky/Nginx-UI/internal/kernel"
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/0xJacky/Nginx-UI/router"
|
||||
"github.com/0xJacky/Nginx-UI/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jpillora/overseer"
|
||||
"errors"
|
||||
"github.com/uozi-tech/cosy"
|
||||
cKernel "github.com/uozi-tech/cosy/kernel"
|
||||
"github.com/uozi-tech/cosy/logger"
|
||||
cRouter "github.com/uozi-tech/cosy/router"
|
||||
cSettings "github.com/uozi-tech/cosy/settings"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Program(confPath string) func(state overseer.State) {
|
||||
|
@ -58,12 +59,10 @@ func Program(confPath string) func(state overseer.State) {
|
|||
}
|
||||
|
||||
func main() {
|
||||
var confPath string
|
||||
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
||||
flag.Parse()
|
||||
appCmd := cmd.NewAppCmd()
|
||||
|
||||
confPath := appCmd.String("config")
|
||||
settings.Init(confPath)
|
||||
|
||||
overseer.Run(overseer.Config{
|
||||
Program: Program(confPath),
|
||||
Address: fmt.Sprintf("%s:%d", cSettings.ServerSettings.Host, cSettings.ServerSettings.Port),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue