How to use the nprogress/nprogress.js.configure function in nprogress

To help you get started, we’ve selected a few nprogress examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Xabaril / Esquio / src / Esquio.UI / ClientApp / src / app / core / interceptor.ts View on Github external
export function registerInterceptor(next = null) {
  nprogress.configure({ showSpinner: false });
  const authService = container.get(cid.IAuthService);

  fetchIntercept.register({
    request: function (url, config) {
      nprogress.start();

      config = config || {};
      const headers = config.headers || {};

      config.headers = {
        ...headers,
        'Content-Type': 'application/json',
        'x-api-version': '2.0',
        Authorization: `Bearer ${authService.user.access_token}`
      };
      return [url, config];