ExpressJS
-
ExpressJS
Fix “Blocked by CORS Policy” in a MERN App (React + Express)
The browser blocks your React app from reading the API response because Express did not send the right CORS headers. Install the cors package and add app.use(cors({ origin: "http://localhost:5173" })) before your routes. If you send cookies, also set credentials: true on the server and credentials: "include" (or withCredentials in Axios) on the client, and never use origin "*" with credentials.
-
ExpressJS
Fix “TypeError: Missing parameter name” After Upgrading to Express 5
Express 5 uses a stricter route syntax, and a bare * in a route path now throws “Missing parameter name”. Give every wildcard a name, for example change app.get("*") to app.get("/{*splat}") and "/files/*" to "/files/*splat". Also change optional parameters such as "/:id?" to "{/:id}", and replace regular-expression characters in route strings with an array of paths.
-
ExpressJS
Fix “Cannot set headers after they are sent to the client” in Express
This error means your code tried to send a second response to a request that was already answered. The usual fix is to add return before res.json() or res.send() inside an if block, so the function stops after responding. Also check for next() called after a response and for callbacks that run twice.
-
Backend
SvelteKit as a Backend: Server Routes, Form Actions and When to Use It
SvelteKit is a full-stack framework: besides Svelte pages, it runs server code in +page.server.js load functions, +server.js API routes, form actions and hooks. That lets one project handle pages, data loading, form submissions and JSON APIs. Choose it for full-stack web apps; keep a separate Express or NestJS API when many different clients share a large backend.
-
Backend
GraphQL vs REST: Which API Style Should You Use?
Choose REST for most APIs: it is simpler, works with HTTP caching out of the box, and every developer knows it. Choose GraphQL when many different clients (web, mobile, partners) need different shapes of deeply related data, and you want them to fetch exactly what they need in one request.
-
Backend
Building Microservices With NestJS: A Practical Step-by-Step Guide
NestJS microservices use @nestjs/microservices: a service listens on a transport such as TCP, Redis, NATS or RabbitMQ, handlers use @MessagePattern for request-response and @EventPattern for fire-and-forget events, and other services call them through a ClientProxy with send() or emit(). Start with a modular monolith and split out services only when you have a clear reason.
-
Backend
How to Migrate an Express App to Express 5 (Step by Step)
To upgrade to Express 5, use Node.js 18 or newer, run npm install express@5, then fix the breaking changes: wildcard routes must be named (/*splat), optional parameters use braces ({/:id}), old methods such as res.send(404) and req.param() are gone, and rejected promises in async handlers now reach your error handler automatically.
-
ExpressJS
React Server Components Explained in Plain English
React Server Components run only on the server. They can read your database or files directly and send finished UI to the browser without adding their code to your JavaScript bundle. Keep components on the server by default, and add "use client" only to the small parts that need state, effects, event handlers or browser APIs.
-
ExpressJS
Node.js Streams: A Practical Guide With Real Examples
A Node.js stream moves data in small chunks instead of loading it all into memory at once. Use fs.createReadStream() to read, connect streams with pipeline() from node:stream/promises so errors and cleanup are handled for you, and reach for a Transform stream when you need to change data as it flows.
-
ExpressJS
Helmet.js: Secure Your Express App With HTTP Security Headers
Install helmet and add app.use(helmet()) near the top of your Express app. It sets security headers such as Content-Security-Policy, Strict-Transport-Security and X-Content-Type-Options, and removes X-Powered-By. If your page breaks afterwards, it is usually the Content Security Policy blocking a script, image or API domain, which you allow in the CSP directives.
-
Backend
Webhooks Explained: Build and Secure a Webhook Endpoint in Express
A webhook is an HTTP POST another service sends to your server when something happens, such as a payment succeeding. To receive one safely in Express, read the raw body with express.raw(), verify the signature header with HMAC and crypto.timingSafeEqual, respond with 2xx quickly, do slow work in the background, and ignore duplicate event ids.
-
ExpressJS
Angular Signals Explained: signal(), computed() and effect() With Examples
A signal is a value that tells Angular when it changes. Create one with signal(0), read it by calling count(), change it with set() or update(), derive values with computed(), and run side effects with effect(). Because Angular knows exactly which signals a template reads, it can update only what changed.












