Can I have multiple frontends? ``` const fronte...
# help
k
Can I have multiple frontends?
Copy code
const frontendOne = new sst.NextjsSite(this, "frontendOne", {
      path: "frontendOne",
    });
    const frontendTwo = new sst.NextjsSite(this, "frontendTwo", {
      path: "frontendTwo",
    });

    this.addOutputs({
      SiteUrl: frontendOne.customDomainUrl || frontendOne.url,
      ApiEndpoint: api.customDomainUrl || api.url,
    });
That probably needs to be a different stack I guess
f
That should work. R u getting an error?
k
Take a closer look. There is frontendTwo. How can I add that?
d
by adding a second SiteUrl like output
k
@Danny like
Copy code
this.addOutputs({
      SiteUrl: frontendOne.customDomainUrl || frontendOne.url,
      SiteUrl: frontendTwo.customDomainUrl || frontendTwo.url,
    });
I might did not understand you, but that's not goona work right?
d
That’s an invalid object. I was thinking
Copy code
this.addOutputs({
      SiteUrl: frontendOne.customDomainUrl || frontendOne.url,
      SiteUrl2: frontendTwo.customDomainUrl || frontendTwo.url,
    });
k
Oh I see, I didn't realise that addOutputs object param keys can be whatever. Will test this out