mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
19 lines
422 B
JavaScript
19 lines
422 B
JavaScript
// accepts www.host.com, defaults domain to skybreakplatform, defaults
|
|
// protocol to http.
|
|
//
|
|
// XXX shared w/ proxy.js
|
|
exports.parse_url = function (url) {
|
|
if (!url.match(':\/\/'))
|
|
url = 'http://' + url;
|
|
|
|
var parsed = require('url').parse(url);
|
|
|
|
delete parsed.host; // we use hostname
|
|
|
|
if (parsed.hostname && !parsed.hostname.match(/\./))
|
|
parsed.hostname += '.skybreakplatform.com';
|
|
|
|
return parsed;
|
|
}
|
|
|