title: How to use multiple subdomains and angular apps with nodejs
body: <p>I want to be able to use multiple, dynamic subdomains, for account holders, while also having an api subdomain. Essentially something like below:</p>
  
  <pre><code>https://example.com --&gt; Angular 4 public landing page app
  https://api.example.com --&gt; NodeJS api
  https://otbs.example.com --&gt; Angular 4 SaaS application
  https://test-account.example.com --&gt; Angular 4 SaaS application
  </code></pre>
  
  <p>The public landing page app is just an Angular 4 app for the public facing application, whereas the SaaS application is the actual application itself, for when users are logged in, and is mapped to a subdomain as per their linked account. </p>
  
  <p>I am using NodeJS, Express 4, Angular 4, and the Angular CLI. My intention would be to use S3 for serving the client Angular applications, while having the NodeJS API run in ElasticBeanstalk. </p>
  
  <p>Is this configuration possible? I have looked in virtual hosting on AWS, but this isn't necessarily what I'm looking for as I need the ability to register a new subdomain every time a new account is created. </p>