Skip to content

Commit 311ea48

Browse files
committed
chore: minor updates and fixes in the last 2 blog articles
1 parent a257c83 commit 311ea48

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

  • src/content/blog

src/content/blog/nodejs-http-request/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
date: 2026-01-29T16:30:00
3-
updatedAt: 2026-01-30T10:44:00
3+
updatedAt: 2026-02-05T00:00:00
44
title: How to make an HTTP request in Node.js
55
slug: nodejs-http-request
66
description: Learn to make HTTP requests in Node.js using built-in fetch(), http/https modules. Covers POST, authentication, streaming, and testing with code examples.
@@ -19,9 +19,11 @@ faq:
1919
answer: No, modern Node.js (18+) includes a built-in fetch() API that handles most use cases. External libraries like axios or got are optional and mainly useful for advanced features like automatic retries, request interceptors, or progress events.
2020
---
2121

22-
Making HTTP requests is one of the most common tasks in Node.js development. Whether you're calling a REST API, fetching data from an external service, or building a web scraper, you'll need to know how to make HTTP requests effectively.
22+
For the longest time I remember using the `request` package (now deprecated) to make HTTP requests in Node.js. Then promises became mainstream and I switched to `request-promise` (also deprecated). In more recent times I moved to `axios` and I thought I would never look back... and yet here we are. The HTTP story in Node.js keeps evolving, and for good reasons!
2323

24-
The good news is that modern Node.js includes everything you need to make HTTP requests without installing any external packages. A simple `fetch()` call is all it takes to get started. But between "it works on my machine" and "it's production-ready" lies a minefield of edge cases: requests that hang forever, unhandled network errors, memory leaks from unhandled streams, retry logic that causes duplicate orders, and tests that accidentally hit real APIs. This guide covers everything you need to confidently ship HTTP code to production—not just the basics, but the patterns, pitfalls, and testing strategies that only surface when things go wrong.
24+
Making HTTP requests is one of the most common tasks in Node.js development. Whether you're calling a REST API, fetching data from an external service, or building a web scraper, you need to know how to do it effectively. The good news is that since Node.js 18, the Web-standard `fetch()` API is available as a built-in global. If you've ever used `fetch()` in the browser, you already know how to use it on the server. No extra dependencies, no wrappers, just the same familiar API giving you everything you need to do HTTP the modern way in Node.js.
25+
26+
But between "it works on my machine" and "it's production-ready" lies a minefield of edge cases: requests that hang forever, unhandled network errors, memory leaks from unhandled streams, retry logic that causes duplicate orders, and tests that accidentally hit real APIs. This guide covers everything you need to confidently ship HTTP code to production, not just the basics, but the patterns, pitfalls, and testing strategies that only surface when things go wrong.
2527

2628
:::note[Prerequisites]
2729
The examples in this guide use **top-level `await`**, which requires ESM (ECMAScript Modules). To use these examples, either:

src/content/blog/nodejs-path-traversal-security/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
date: 2026-02-02T18:17:00
3-
updatedAt: 2026-02-02T18:17:00
3+
updatedAt: 2026-02-05T00:00:00
44
title: 'Node.js Path Traversal: Prevention & Security Guide'
55
slug: nodejs-path-traversal-security
66
description: Learn to prevent path traversal attacks in Node.js. Secure file servers with input validation, boundary checks, and defense-in-depth patterns.
@@ -943,6 +943,6 @@ For a deeper dive into Node.js security, consider:
943943

944944
- **Node.js Design Patterns** - Our book covers security patterns and best practices throughout ([learn more](/))
945945
- **[Liran Tal's Node.js Security](https://www.nodejs-security.com/)** - Comprehensive Node.js security resources
946-
- **[Snyk's Node.js Security Guide](https://snyk.io/blog/nodejs-security-best-practices/)** - Modern security practices
946+
- **[Snyk's Node.js Security Guide](https://snyk.io/articles/nodejs-security-best-practice/)** - Modern security practices
947947

948948
Remember: **security is an ongoing process**, not a one-time fix. Stay informed about new vulnerabilities, regularly review your code, and always prioritize secure coding practices from the start.

0 commit comments

Comments
 (0)