Skip to content

Instantly share code, notes, and snippets.

@simonschwartz
Last active May 19, 2019 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonschwartz/611fc553da15272c344f4927d0084bfe to your computer and use it in GitHub Desktop.
Save simonschwartz/611fc553da15272c344f4927d0084bfe to your computer and use it in GitHub Desktop.
const createURL = (baseURL, path) => {
const protocol = "https";
return `${protocol}://${baseURL}/${path}`;
};
// create URLs for our main site
const homeURL = createURL("mysite.com", "");
const loginURL = createURL("mysite.com", "login");
const productsURL = createURL("mysite.com", "products");
const contactURL = createURL("mysite.com", "contact-us");
// create URLs for our careers site
const careersHomeURL = createURL("mysite-careers.com", "");
const careersLoginURL = createURL("mysite-careers.com", "login");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment