src/route/SetRoute.js
function setRoot(mountpath) {

    // mount to root if not mountpath
    let root=mountpath?mountpath:"";
    // add leading slash if needed
    root=root.match(/^\/.*/)?root:`/${root}`;
    // chop off trailing slash
    root=root.match(/^.*\/$/)?root.substring(0,root.length-1):root; 
    // if root is just slash then mountpath is empty (load on root of site)
    root=root.length>1?root:"";
    return root;
}
function setRoot(mountpath) {

    // mount to root if not mountpath
    let root=mountpath?mountpath:"";
    // add leading slash if needed
    root=root.match(/^\/.*/)?root:`/${root}`;
    // chop off trailing slash
    root=root.match(/^.*\/$/)?root.substring(0,root.length-1):root; 
    // if root is just slash then mountpath is empty (load on root of site)
    root=root.length>1?root:"";
    return root;
}
function setRoot ( mountpath ) { // mount to root if not mountpath let root = mountpath ? mountpath : "" ; // add leading slash if needed root = root . match ( / ^\/.* / ) ? root : ` ${ root } ` ; // chop off trailing slash root = root . match ( / ^.*\/$ / ) ? root . substring ( 0 , root . length - 1 ) : root ; // if root is just slash then mountpath is empty (load on root of site) root = root . length > 1 ? root : "" ; return root ; }
make sure that mountpath has a leading slash and no training slash
make sure that mountpath has a leading slash and no training slash