component-driven/component-driven-development

Remove URL hack

Closed this issue · 0 comments

This was made when we were deploying the app in a subfolder on GitHub Pages, but now we deploy it the the root folder with Netlify, so this shouldn't be needed anymore.c

// HACK: Make the app work when deployed in a subfolder
const DEPLOY_PATH = '/component-driven-development';
export const getUrl = path => {
const { pathname } = document.location;
const basePath = pathname.startsWith(DEPLOY_PATH) ? DEPLOY_PATH : '';
return [basePath, path].join('');
};