Dax Raad пре 2 месеци
родитељ
комит
4309c078fb
3 измењених фајлова са 11 додато и 3 уклоњено
  1. 2 3
      infra/enterprise.ts
  2. 6 0
      infra/stage.ts
  3. 3 0
      packages/enterprise/src/routes/index.tsx

+ 2 - 3
infra/enterprise.ts

@@ -1,14 +1,13 @@
 import { SECRET } from "./secret"
-import { domain } from "./stage"
+import { domain, shortDomain } from "./stage"
 
 const storage = new sst.cloudflare.Bucket("EnterpriseStorage")
 
 const enterprise = new sst.cloudflare.x.SolidStart("Enterprise", {
-  domain: "enterprise." + domain,
+  domain: shortDomain,
   path: "packages/enterprise",
   buildCommand: "bun run build:cloudflare",
   environment: {
-    OPENCODE_BASE_URL: "/t",
     OPENCODE_STORAGE_ADAPTER: "r2",
     OPENCODE_STORAGE_ACCOUNT_ID: sst.cloudflare.DEFAULT_ACCOUNT_ID,
     OPENCODE_STORAGE_ACCESS_KEY_ID: SECRET.R2AccessKey.value,

+ 6 - 0
infra/stage.ts

@@ -11,3 +11,9 @@ new cloudflare.RegionalHostname("RegionalHostname", {
   regionKey: "us",
   zoneId: zoneID,
 })
+
+export const shortDomain = (() => {
+  if ($app.stage === "production") return "opncd.ai"
+  if ($app.stage === "dev") return "dev.opncd.ai"
+  return `${$app.stage}.dev.opncd.ai`
+})()

+ 3 - 0
packages/enterprise/src/routes/index.tsx

@@ -0,0 +1,3 @@
+export default function () {
+  return <div>Hello World</div>
+}