• Robert Knight's avatar
    Add a service for fetching the API route directory and page links. · 5b214a6e
    Robert Knight authored
    Fetching the API route directory is currently the responsibility of the
    API client ("store") service. The "store" service makes authenticated
    API calls and therefore depends on the "auth" service.
    
    This means that we cannot use the API route directory or the page links
    returned from `/api/links` in the auth service itself, as this would
    introduce a circular dependency.
    
    Factoring out the responsibility for fetching the `/api` and
    `/api/links` endpoints into a separate service which does not use
    authentication provides a way to resolve this problem.
    
    It also makes testing some aspects of handling these endpoints, such as
    caching and auto-retry if the HTTP request fails, a little easier.
    5b214a6e
api-routes-test.js 3.36 KB