almost all ready
This commit is contained in:
@@ -92,6 +92,7 @@ func run() error {
|
||||
cartService,
|
||||
render.New(assetManifest),
|
||||
cfg,
|
||||
productRoute,
|
||||
categoryRoute,
|
||||
)
|
||||
categoryHandler := handlers.NewCategoryHandler(
|
||||
@@ -103,6 +104,16 @@ func run() error {
|
||||
productRoute,
|
||||
categoryRoute,
|
||||
)
|
||||
cartHandler := handlers.NewCartHandler(cartService, cookieCodec, sessionService)
|
||||
cartPageHandler := handlers.NewCartPageHandler(
|
||||
productService,
|
||||
customerService,
|
||||
cartService,
|
||||
render.New(assetManifest),
|
||||
cfg,
|
||||
productRoute,
|
||||
categoryRoute,
|
||||
)
|
||||
|
||||
proxyHandler, err := httpproxy.New(cfg.PrestaShopProxyTarget)
|
||||
if err != nil {
|
||||
@@ -125,6 +136,10 @@ func run() error {
|
||||
e.GET("/healthz", handlers.Healthz())
|
||||
e.GET("/readyz", handlers.Readyz(appStore, prestaDB, cfg.PrestaShopProxyTarget))
|
||||
e.Match([]string{http.MethodGet, http.MethodPost}, "/debug/cookie/decode", handlers.DecodeCookie(cookieCodec))
|
||||
e.GET("/cart", cartPageHandler.Show)
|
||||
e.GET("/:lang/cart", cartPageHandler.Show)
|
||||
e.Match([]string{http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete}, "/cart", cartHandler.Handle)
|
||||
e.Match([]string{http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete}, "/:lang/cart", cartHandler.Handle)
|
||||
e.GET("/*", func(c echo.Context) error {
|
||||
productMatch, productOK := productRoute.MatchInfo(c.Request().URL.Path)
|
||||
categoryMatch, categoryOK := categoryRoute.MatchInfo(c.Request().URL.Path)
|
||||
|
||||
Reference in New Issue
Block a user