package main

import (
	"fmt"
	"go.uber.org/zap"
	"projectName/cmd/server/wire"
	"projectName/pkg/config"
	"projectName/pkg/http"
	"projectName/pkg/log"
)

func main() {
	conf := config.NewConfig()
	logger := log.NewLog(conf)

	logger.Info("server start", zap.String("host", conf.GetString("http.host")+conf.GetString("http.port")))

	app, cleanup, err := wire.NewWire(conf, logger)
	if err != nil {
		panic(err)
	}
	defer cleanup()

	http.Run(app, fmt.Sprintf("%s:%d", conf.GetString("http.host"), conf.GetInt("http.port")))
}
