Added pars config for Server, Added basic struct of server, Added first router Hello, Added test for router Hello

This commit is contained in:
Shuhrat Tultaganov committed 2022-12-07 21:29:01 +03:00
1 parent de0129d81f
commit 2a5c0b9ffa
11 files changed
+185 -4

No files matched your search

+25 -2
View File
@@ -1,7 +1,30 @@
package main
import "fmt"
import (
"flag"
"log"
"git.ukamnya.ru/stulyaganov/RestApi/internal/restserver"
)
var (
configPath string
)
func init() {
flag.StringVar(&configPath, "config-path", "configs/restServer/config.yaml", "path for config file")
}
func main() {
fmt.Printf("Hello rest api")
flag.Parse()
config := restserver.NewConfig()
if err := config.SetConfig(configPath); err != nil {
log.Fatal(err)
}
s := restserver.New(config)
if err := s.Start(); err != nil {
log.Fatal(err)
}
}