forked from ebhomengo/niki
26 lines
528 B
Go
26 lines
528 B
Go
package setup
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/config"
|
|
httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
|
|
"git.gocasts.ir/ebhomengo/niki/service"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
type TestServer struct {
|
|
router *echo.Echo
|
|
}
|
|
|
|
func NewTestServer(cfg config.Config, svc *service.Service) *TestServer {
|
|
s := httpserver.New(cfg, svc)
|
|
s.RegisterRoutes()
|
|
|
|
return &TestServer{router: s.Router}
|
|
}
|
|
|
|
func (t *TestServer) Serve(w http.ResponseWriter, r *http.Request) {
|
|
t.router.ServeHTTP(w, r)
|
|
}
|