fullstack-app icon indicating copy to clipboard operation
fullstack-app copied to clipboard

More detail on changing domain name

Open jamesladd opened this issue 5 years ago • 1 comments

This is looking really good and its very fast to run. Thank you.

I followed the doc to make a .env file for each of my stages. I'm also hoping to have a domain specific for the stage, like test.api.domain.com or api.test.domain.com but this is causing certificate issues etc

A simple domain like mydomain.com works great, and I get a site at www.mydomain.com and an api at api.mydomain.com

Please can you provide more information / examples on customising the domain for different stages?

jamesladd avatar Aug 01 '20 05:08 jamesladd

Have you tried the following?

# .env.dev
DOMAIN=dev.example.com
# .env.prod
DOMAIN=example.com

component: website
name: my-website

inputs:
  src: ./src
  domain: ${env:DOMAIN}

When you run sls deploy --stage dev, the .env.dev file will be picked up, when you run sls deploy --stage prod, the .env.prod will be picked up.

eahefnawy avatar Aug 05 '20 10:08 eahefnawy