frontend and backend base setup
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user