I was thinking about building something like this ...
# help
d
I was thinking about building something like this
Copy code
myCoolApp
  /stacks
  /frontend - a react app 
  /website - a gatsby site
I’d then have my app deploy at
Copy code
<http://app.myCoolApp.com|app.myCoolApp.com> //react site
<http://www.myCoolApp.com|www.myCoolApp.com> //gatsby
<http://myCoolApp.com|myCoolApp.com> // gatsby
Or something. Really I just want to avoid Next but have some static content for SEO. Any ideas?
This is what I’m going with but I have no idea if this is correct
Copy code
const reactApp = new sst.ReactStaticSite(this, "ReactSite", {
      path: "frontend",
      customDomain:
        scope.stage === "prod"
          ? {
              domainName: `app.${URL}`,
              domainAlias: `wwww.app.${URL}`,
            }
          : {
              domainName: `dev.app.${URL}`,
              domainAlias: `wwww.dev.app.${URL}`,
            },
    });

    const staticSite = new sst.StaticSite(this, "Site", {
      path: "website/index.html",
      customDomain:
        scope.stage === "prod"
          ? {
              domainName: `${URL}`,
              domainAlias: `wwww.${URL}`,
            }
          : {
              domainName: `dev.${URL}`,
              domainAlias: `wwww.dev.${URL}`,
            },
    });
I also added a hosted domain here too
j
Why the desire to avoid Next specifically?
d
I’ve never gotten it to work
dev/prod
with a deployment using serverless
there’s also a little bit of me that wants to use Remix when it comes out so why bother learning next
j
Where there specific sticking points that got you with Next and SST? or serverless generally?
d
with sst it’s the environmental variables once I added auth… stuff like that. It’s always been something. If this subdomain thing works I think that a react app with a static app will be perfect for my needs.
j
gatsby is good for static and seo, subdomain setup seems reasonable
whats your backend to the react app?
d
I’m just going to use API Gateway
so this sorta worked btw