don't we want to just replace `var env = parsed.host;` above by `var env = parsed.url;` ?