How to retry failed requests in Node.js
Transient network failures, rate limit errors, and temporary server unavailability are facts of life when calling external APIs, and retrying with exponential backoff is the standard way to handle them gracefully. As the creator of CoreUI with 25 years of backend development experience, I implement retry logic in every Node.js service that calls external APIs, as a single unretried request failure can cascade into user-visible errors. The key design is exponential backoff with jitter — each retry waits longer than the last, and a random jitter prevents thundering herd problems when many requests fail simultaneously. Only retry idempotent requests (GET, PUT, DELETE) by default; POST requests need careful consideration to avoid duplicate side effects.
How to download files in Angular
Downloading files in Angular requires fetching the file as a binary blob, creating an object URL, and triggering a click on a hidden anchor element to initiate the browser download.
As the creator of CoreUI with Angular development experience since 2014, I’ve implemented file downloads for PDF reports, CSV exports, and document management in enterprise Angular applications.
The key is setting responseType: 'blob' on the HttpClient request and extracting the filename from the Content-Disposition header when the server provides it.
This works for any file type — PDFs, ZIPs, Excel files, images — without requiring any third-party library.
How to upload files in Angular
File upload in Angular requires combining an HTML file input with Angular’s HttpClient and the browser’s FormData API to send files as multipart form data.
As the creator of CoreUI with Angular development experience since 2014, I’ve implemented file upload components for profile photos, document management systems, and bulk import tools in enterprise applications.
The correct approach uses reportProgress: true with HttpEventType to track upload progress, giving users real-time feedback on large file uploads.
Combining this with client-side validation for file type and size prevents wasted network requests.
How to integrate Angular with REST API
Integrating Angular with a REST API is a fundamental task in every enterprise application, and doing it correctly requires understanding Angular’s HttpClient module and RxJS observables.
As the creator of CoreUI and an Angular developer since 2014, I’ve built REST integrations for dozens of production dashboards and admin panels.
The cleanest approach is to encapsulate all HTTP calls in a dedicated service, inject it into components, and handle responses reactively using RxJS operators.
This keeps components focused on presentation and makes API logic easy to test.
How to use axios in Node.js
Making HTTP requests in Node.js applications often requires more features than the native fetch API provides, such as automatic JSON transformation, request cancellation, and interceptors. With over 10 years of experience building Node.js applications since 2014 and as the creator of CoreUI, a widely used open-source UI library, I’ve used axios in countless production backends and services. The most powerful and flexible approach is to use axios, a promise-based HTTP client that provides a rich feature set with a clean API. This method offers automatic JSON parsing, request and response interceptors, and built-in support for timeouts and error handling.
How to use fetch in Node.js
Making HTTP requests in Node.js has traditionally required third-party libraries, but starting with Node.js 18, the native fetch API is available without any dependencies. With over 10 years of experience building Node.js applications since 2014 and as the creator of CoreUI, a widely used open-source UI library, I’ve implemented countless API integrations in production environments. The most modern and efficient approach is to use the native fetch API, which brings the same familiar browser API to the server side. This method eliminates external dependencies while providing a clean, promise-based interface for HTTP requests.
How to mock HttpClient in Angular tests
Testing components and services that make HTTP requests requires mocking to avoid actual API calls and ensure tests run fast and reliably.
With over 12 years of Angular development experience since 2014 and as the creator of CoreUI, I’ve written extensive test suites for HTTP-based services.
Angular provides HttpClientTestingModule and HttpTestingController specifically for mocking HTTP requests in tests.
This approach allows you to verify requests are made correctly and control response data for different test scenarios.
How to cache API responses in Angular
Caching API responses reduces unnecessary network requests, improves application performance, and provides better user experience.
As the creator of CoreUI, a widely used open-source UI library, I’ve implemented caching strategies in Angular applications throughout my 11 years of framework development.
The most effective approach is using the RxJS shareReplay operator in your services to cache observable responses.
This method automatically shares cached data across multiple subscribers and reduces API calls.
How to build a REST API in Node.js
Building REST APIs in Node.js is fundamental for creating backend services that power modern web and mobile applications with standardized HTTP operations. With over 25 years of backend development experience and as the creator of CoreUI, I’ve built countless REST APIs for enterprise applications and open-source projects. The most effective approach is using Express.js with proper HTTP methods, status codes, and JSON responses following REST conventions. This provides a scalable, maintainable API architecture that integrates seamlessly with any frontend framework.
How to use concatMap operator in Angular
The concatMap operator is crucial for maintaining order in Angular applications when processing observables sequentially, ensuring each request completes before the next begins. As the creator of CoreUI with over 25 years of development experience, I use concatMap when order matters and you need guaranteed sequential processing. The most effective use case is for operations that must complete in order, such as file uploads or sequential API calls that depend on previous results. This ensures data integrity and prevents race conditions in your Angular application.