This repository has been archived on 2025-09-01. You can view files and clone it, but cannot push or open issues or pull requests.

26 lines
354 B
Go

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)
}
}