Routing reference
This page maps apps/cosmos/digital-services/src/pages routes to ownership and edge behavior.
Route inventory
Section titled “Route inventory”| Route | Source file | Primary owner | Notes |
|---|---|---|---|
/ | src/pages/index.astro | Astro page + Layout.astro | Marketing landing page. |
/contact | src/pages/contact.astro | Astro page + contact form scripts | Uses PUBLIC_CONTACT_FORM_WORKER_URL. |
/login | src/pages/login.astro | Astro page + Cloudflare Access flow | Entry point before protected routes. |
/maintenance | src/pages/maintenance.astro | Astro middleware gate | Activated by PUBLIC_MAINTENANCE_MODE. |
/portal | src/pages/portal.astro | Astro page, edge-protected | Protected by gateway worker prefix rules. |
/portal/outgoing-mail | src/pages/portal/outgoing-mail.astro | Astro UI + worker-backed API | Protected route and authenticated tool flow. |
/solutions/automation | src/pages/solutions/automation.astro | Astro marketing page | Shared UI composition. |
/solutions/consulting | src/pages/solutions/consulting.astro | Astro marketing page | Shared UI composition. |
/solutions/ecommerce | src/pages/solutions/ecommerce.astro | Astro marketing page | Shared UI composition. |
/solutions/webdesign | src/pages/solutions/webdesign.astro | Astro marketing page | Shared UI composition. |
/robots.txt | src/pages/robots.txt.ts | Astro API route | Generates sitemap URL from site/env. |
/sitemap.xml | src/pages/sitemap.xml.ts | Astro API route | Uses explicit route list (SITEMAP_ENTRIES). |
Edge-owned overlays
Section titled “Edge-owned overlays”/api/*is owned byworkers/auth-gateway.jsroute matching inworkers/wrangler.gateway.toml./api/auth/sessionand/api/auth/logoutare gateway worker endpoints, notsrc/pagesfiles./portal*and/admin*protection comes from gateway route +PROTECTED_PATH_PREFIXES.- Image optimization is route-claimed by
workers/wrangler.image.tomlandworkers/image-optimizer.js.
Ownership model
Section titled “Ownership model”- Page content and markup:
src/pages/*. - Global nav/auth link and metadata defaults:
src/layouts/Layout.astro. - Route-wide maintenance override:
src/middleware.ts. - Auth/session/logout/protected redirect behavior:
workers/auth-gateway.js.
Change safety checklist
Section titled “Change safety checklist”- Add/rename route in
src/pages: verify sitemap and navigation impact. - Add protected route under
/portalor/admin: confirm Wrangler routes and prefixes still cover it. - Add browser API calls: validate CSP
connect-src/form-actioninpublic/_headers.