package server

import (
	"local/router"
	"local/rssmon3/config"
	"local/rssmon3/monitor"
	"strings"
)

type Server struct {
	Port   string
	router *router.Router
	Jobs   chan<- *monitor.Item
}

func New(jobs chan<- *monitor.Item) *Server {
	config := config.Values()
	s := &Server{
		Port:   ":" + strings.TrimPrefix(config.Port, ":"),
		router: router.New(),
		Jobs:   jobs,
	}
	return s
}
