package server

import (
	"log"
	"net/http"
	"strconv"
)

type IServer interface {
	ListenAndServe()
}

type Server struct {
	Addr   string
	Server http.Server
	Port   int
}

func (s *Server) ListenAndServe() {
	s.Addr = s.Addr + ":" + strconv.Itoa(s.Port)
	serverError := s.Server.ListenAndServe()
	if serverError != nil {
		log.Fatal(serverError)
	}
}
