serverless-components / website

:zap: Instantly deploy static website on serverless infrastructure with zero configuration using Serverless Components.
https://serverless.com
Apache License 2.0
155 stars 49 forks source link

Wildcard Domains Fail #79

Open EyeDreamt opened 3 years ago

EyeDreamt commented 3 years ago

When trying to set a wildcard domain you get an error saying the domain isn't a valid domain.

ex in yaml:

domain: "*.myapp.com"

result:

41s » Serverless » "*.myapp.com" is not a valid domain.

Gabiras12 commented 3 years ago

Hi. I've made a fork that makes subdomain and wildcard work. It's here: https://github.com/Gabiras12/website Basically, you define your domain as here but add an additional component input generateWildcardSubdomain. E.g:

component: website-wildcard-domains        # (required) name of the component. In that case, it's website.
name: my-website                 # (required) name of your website component instance.
org: serverlessinc               # (optional) serverless dashboard org. default is the first org you created during signup.
app: my-app                      # (optional) serverless dashboard app. default is the same as the name property.
stage: dev                       # (optional) serverless dashboard stage. default is dev.

inputs:
  src: ./src                     # (optional) path to the source folder. default is a hello world html file.
  domain: myapp.com         # (optional) domain name. this could also be a subdomain.
  generateWildcardSubdomain: true

this will publish the website at the domain and at *.domain notice I've published the component under a different name.