Rename the dashboard program castle-app -> castle
The dashboard is now served at castle.<domain> (was castle-app.<domain>). Since the subdomain is the program name, this is just a program rename plus the one special-case constant. - Generator: _DASHBOARD = "castle" (the :9000 redirect target and off-mode root). - Program file renamed (runtime): programs/castle-app.yaml -> programs/castle.yaml (source unchanged: repo:app). - Dashboard UI: ProgramDetail shows a frontend's subdomain (via subdomainUrl), dropping the old castle-app-at-root special-case; comment refs updated. - Docs: registry.md/design.md/react-vite.md updated to the subdomain model and the `castle` name (react-vite.md also corrected — frontends serve at their subdomain root with VITE_BASE=/, and builds are manual via `castle program build`, not deploy).
This commit is contained in:
@@ -50,7 +50,7 @@ export function stackLabel(stack: string): string {
|
||||
|
||||
/**
|
||||
* Full URL for a service exposed at <subdomain>.<gateway.domain>. The domain is
|
||||
* derived from the dashboard's own host (it is served at castle-app.<domain>), so
|
||||
* derived from the dashboard's own host (it is served at castle.<domain>), so
|
||||
* this returns null when the dashboard is on a bare host (off mode, no subdomains).
|
||||
*/
|
||||
export function subdomainUrl(subdomain: string): string | null {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react"
|
||||
import { useParams } from "react-router-dom"
|
||||
import { useProgram, useEventStream } from "@/services/api/hooks"
|
||||
import { runnerLabel } from "@/lib/labels"
|
||||
import { runnerLabel, subdomainUrl } from "@/lib/labels"
|
||||
import { DetailHeader } from "@/components/detail/DetailHeader"
|
||||
import { ConfigPanel } from "@/components/detail/ConfigPanel"
|
||||
import { DeploymentsSection } from "@/components/detail/DeploymentsSection"
|
||||
@@ -28,14 +28,12 @@ export function ProgramDetailPage() {
|
||||
)
|
||||
}
|
||||
|
||||
// A static frontend (frontend behavior, build outputs, no service) is served
|
||||
// by the gateway in place — show where.
|
||||
// A static frontend (frontend behavior, build outputs, no service) is served by
|
||||
// the gateway in place at its own subdomain — show where.
|
||||
const buildOutputs = (deployment.manifest.build as { outputs?: string[] } | undefined)?.outputs
|
||||
const servedAt =
|
||||
deployment.behavior === "frontend" && deployment.services.length === 0 && buildOutputs?.length
|
||||
? deployment.id === "castle-app"
|
||||
? "/"
|
||||
: `/${deployment.id}/`
|
||||
? (subdomainUrl(deployment.id) ?? `${deployment.id}.<gateway.domain>`)
|
||||
: null
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Resolve the castle-api base URL. The gateway serves each service at its own
|
||||
// subdomain (<name>.<domain>), so when the dashboard runs at castle-app.<domain>
|
||||
// subdomain (<name>.<domain>), so when the dashboard runs at castle.<domain>
|
||||
// the API lives at castle-api.<domain> — a cross-origin call (castle-api allows
|
||||
// CORS *). When served at a bare host (dev, or the off-mode :9000 gateway), the
|
||||
// API is reachable same-origin at /api.
|
||||
|
||||
Reference in New Issue
Block a user