Taken from the Meteor Forums .
DNS, *.example.com , :
var hostnameArray = document.location.hostname.split( "." );
if ( hostnameArray[1] === "example" && hostnameArray[2] === "com" ) {
var subdomain = hostnameArray[0];
}
if ( subdomain ) {
Meteor.call( "findTeamBySubdomain", subdomain, function (err, res) {
var teamId = res;
if ( teamId )
Session.set( "teamId", teamId );
}
});
}
Tracker.autorun ( function () {
Meteor.subscribe( "teamInfo", Session.get( "teamId" ) );
});
, , , teamId. : " ". , .