33 lines
524 B
Go
33 lines
524 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
|
|
"git.ukamnya.ru/stulyaganov/RestApiv2/internal/restserver"
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
var (
|
|
configPath string
|
|
)
|
|
|
|
func init() {
|
|
flag.StringVar(&configPath, "config-path", "configs/restServer/config.yaml", "path for config file")
|
|
}
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
godotenv.Load(".env")
|
|
|
|
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)
|
|
}
|
|
}
|