mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
Refactor installation and database initialization.
Added optional database name to installation.
This commit is contained in:
parent
759a235e7e
commit
3bf2677d69
8 changed files with 70 additions and 33 deletions
12
main.go
12
main.go
|
@ -25,21 +25,21 @@ func main() {
|
|||
_ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8")
|
||||
|
||||
var confPath string
|
||||
flag.StringVar(&confPath, "config", "./app.ini", "Specify the configuration file")
|
||||
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
||||
flag.Parse()
|
||||
|
||||
settings.Init(confPath)
|
||||
model.Init()
|
||||
log.Printf("nginx config dir path: %s", tool2.GetNginxConfPath(""))
|
||||
if "" != settings.ServerSettings.JwtSecret {
|
||||
model.Init()
|
||||
go tool2.AutoCert()
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: ":" + settings.ServerSettings.HttpPort,
|
||||
Handler: router.InitRouter(),
|
||||
}
|
||||
|
||||
log.Printf("nginx config dir path: %s", tool2.GetNginxConfPath(""))
|
||||
|
||||
go tool2.AutoCert()
|
||||
|
||||
// Initializing the server in a goroutine so that
|
||||
// it won't block the graceful shutdown handling below
|
||||
go func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue