function ResourceItem({ name, length }) { return `
  • /${name} ${length ? `${length}x` : 'object'}
  • ` } function ResourceList({ db }) { return ` ` } function NoResources() { return `

    No resources found

    ` } function ResourcesBlock({ db }) { return `

    Resources

    ${Object.keys(db).length ? ResourceList({ db }) : NoResources()}
    ` } window .fetch('db') .then((response) => response.json()) .then( (db) => (document.getElementById('resources').innerHTML = ResourcesBlock({ db })), ) function CustomRoutesBlock({ customRoutes }) { const rules = Object.keys(customRoutes) if (rules.length) { return `

    Custom Routes

    ${rules .map( (rule) => ``, ) .join('')}
    ${rule} ${customRoutes[rule]}
    ` } } window .fetch('__rules') .then((response) => response.json()) .then( (customRoutes) => (document.getElementById('custom-routes').innerHTML = CustomRoutesBlock({ customRoutes, })), )