23 lines
467 B
Go
Executable File

package http
import (
"actatempus_backend/internal/infrastructure/persistence/config"
"fmt"
"net/http"
)
type Server struct {
cfg *config.Config
}
func NewServer(cfg *config.Config) *Server {
return &Server{cfg: cfg}
}
func (s *Server) Start() error {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Welcome to ActaTempus!")
})
return http.ListenAndServe(fmt.Sprintf(":%s", s.cfg.Port), nil)
}