package main

import (
	"Wine-Server/handlers"
	"Wine-Server/handlers/debugger"
	"Wine-Server/handlers/manager"
	"Wine-Server/handlers/seller"
	"Wine-Server/handlers/worker"
	"Wine-Server/utils"
	"os"
)

func main() {
	args, filepath := os.Args, "config.json"
	if len(args) == 2 {
		filepath = args[1]
	}
	config := utils.ReadConfig(filepath)
	app := handlers.CreateApp(&config)
	app.RouteRegister(
		seller.Router,
		manager.Router,
		worker.Router,
		debugger.Router,
	)
	app.Start()
}
