add custom page LiveView with catch-all routing

Shop.CustomPage handles /:slug catch-all for CMS pages. Restructured
router so the catch-all is last — all admin, auth, setup, and SEO
routes defined before the shop scope to prevent interception.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-28 02:21:11 +00:00
parent cf627bd585
commit ad2f2517e5
4 changed files with 300 additions and 89 deletions

View File

@@ -9,12 +9,13 @@ defmodule BerrypodWeb.Plugs.BrokenUrlTrackerTest do
end
test "records broken URL on 404", %{conn: conn} do
conn = get(conn, "/zz-nonexistent-path")
# Multi-segment path — not caught by the /:slug catch-all route
conn = get(conn, "/zz/nonexistent-path")
assert conn.status in [404, 500]
[broken_url] = Redirects.list_broken_urls()
assert broken_url.path == "/zz-nonexistent-path"
assert broken_url.path == "/zz/nonexistent-path"
assert broken_url.recent_404_count == 1
end