sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.04k stars 113 forks source link

Domain across stages #391

Closed felipemotarocha closed 1 month ago

felipemotarocha commented 1 month ago

How can I set different domains depending on the stage of my app? I want to set a different domain to prod and dev environment.

I didn't see anything on the docs related to that. I know that in SST we could do something like this:

new NextjsSite(stack, "site", {
  customDomain:
    stack.stage === "prod" ? "my-app.com" : `${stack.stage}.my-app.com`,
});

Can someone help me with this please?

zohaibakber commented 1 month ago
 domain: $app.stage === "prod" ? `app.${domain}` : `stage.${domain}`,

https://ion.sst.dev/docs/reference/global/

thdxr commented 1 month ago

^ yep can see all globals here: https://ion.sst.dev/docs/reference/global/#_top

felipemotarocha commented 1 month ago

Thanks so much guys!