From 83adba1c7ec0f945f9fc992dbce6e84dfcbd7dcb Mon Sep 17 00:00:00 2001 From: kamalshkeir Date: Mon, 25 Jul 2022 19:01:48 +0200 Subject: [PATCH] fix --- core/kamux/server.go | 5 +---- core/kamux/utils.go | 14 ++++++++++++++ version.txt | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/core/kamux/server.go b/core/kamux/server.go index 8717446..0769bb0 100644 --- a/core/kamux/server.go +++ b/core/kamux/server.go @@ -30,7 +30,6 @@ func (router *Router) initServer() { } else { handler = router } - // add global cors host := settings.GlobalConfig.Host if host == "" { host = "127.0.0.1" @@ -46,9 +45,7 @@ func (router *Router) initServer() { ReadTimeout: 5 * time.Second, WriteTimeout: 20 * time.Second, IdleTimeout: 20 * time.Second, - } - fmt.Printf(logger.Yellow, logger.Ascii7) - fmt.Printf(logger.Blue, "-------⚡🚀 http://"+host+":"+port+" 🚀⚡-------") + } router.Server=&server } diff --git a/core/kamux/utils.go b/core/kamux/utils.go index 6f18ca9..eaeeb88 100644 --- a/core/kamux/utils.go +++ b/core/kamux/utils.go @@ -4,6 +4,7 @@ import ( "embed" "encoding/csv" "encoding/json" + "fmt" "io/fs" "net/http" "os" @@ -62,6 +63,19 @@ func (router *Router) LoadEnv(files ...string) { } } +func (router *Router) PrintServerStart() { + host := settings.GlobalConfig.Host + if host == "" { + host = "127.0.0.1" + } + port := settings.GlobalConfig.Port + if port == "" { + port = "9313" + } + fmt.Printf(logger.Yellow, logger.Ascii7) + fmt.Printf(logger.Blue, "-------⚡🚀 http://"+host+":"+port+" 🚀⚡-------") +} + func LoadTranslations() { if dir,err := os.Stat(settings.TranslationFolder);err == nil && dir.IsDir() { err = filepath.WalkDir(dir.Name(),func(path string, d fs.DirEntry, err error) error { diff --git a/version.txt b/version.txt index 2411653..c52db98 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.2 \ No newline at end of file +0.5.3 \ No newline at end of file