almost all ready

This commit is contained in:
2026-05-14 01:48:15 +02:00
parent 1b53c1c199
commit d55b0e2914
29 changed files with 5489 additions and 650 deletions
+15
View File
@@ -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)