Is there any tutorial/guide on how to use custom-d...
# sst
a
Is there any tutorial/guide on how to use custom-domain with API Construct and SEED stages?
f
SEED stages are passed into the build command
sst deploy --stage STAGE
, you can configure the domain like:
Copy code
sst.Api(this, "Api", {
  customDomain: app.stage === "prod"
    ? "<http://api.mydomain.com|api.mydomain.com>"
    : `${app.stage}.<http://api.mydomain.com|api.mydomain.com>`,
  ...
});
Is this what you are looking for?
a
Yeah actually I used this..
Copy code
customDomain: `api.${scope.stage}.<http://company-dev.net|company-dev.net>`,
But on SEED is using my local
sst.json
config, not the stage from SEED. My json is:
Copy code
{
  "name": "mycompany",
  "stage": "local",
  "region": "ap-southeast-1",
  "lint": false,
  "typeCheck": false
}
Not sure why the
stage
is not being mapped to SEED stage, but the local file instead.
f
Hey @Adrián Mouly, you mean if you
scope.stage
has the stage from
sst.json
, not the stage on Seed?
a
Yeah, found the issue, sorry, I was building the app with NPM and also SEED was building the app with YARN.