2

I would like to give the user a sub domain with their user name when they sign up.

Example is a user with josh sign up, I would like to give him a sub domain josh.example.com where his profile is visible. Is this possible in meteor js?

Michel Floyd
  • 18,793
  • 4
  • 24
  • 39
  • Turns out my answer was incomplete. There is a better answer to this question here: http://stackoverflow.com/a/31488845/2805154 – Michel Floyd Apr 25 '16 at 00:54

1 Answers1

1

There is a solution on the Meteor Forums. It involves using a wildcard dns entry:

Use a DNS wildcard to point *.example.com to your app server, then determine the hostname in your client code:

var hostnameArray = document.location.hostname.split( "." ); var hostname = hostnameArray[0];

if ( hostname ) { // here you can do whatever you need to do with the hostname }

Michel Floyd
  • 18,793
  • 4
  • 24
  • 39