package main

import (
	"fmt"
	"log"

	_ "github.com/go-sql-driver/mysql"

	"git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/fiber"
	sp "git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/service_provider"
)

func main() {
	serviceProvider, err := sp.Init()
	if err != nil {
		log.Fatal(err)
	}

	fiberApp, err := fiber.Init(serviceProvider)
	if err != nil {
		log.Fatal(err)
	}

	if err = fiberApp.Listen(fmt.Sprintf(":%d", serviceProvider.ConfigService().AppPort())); err != nil {
		log.Fatal(err)
	}
}
