
Building a Traffic-Splitting URL Shortener with Node.js, React, and Render
Deploying a full stack JavaScript application sounds straightforward until subtle runtime differences surface in production. What works locally can fail in a managed environment. This article walks through the architecture and deployment of a traffic-splitting URL shortener built with Node.js , Express , React, and Render, including a key issue encountered with Express version compatibility. Architecture Overview The system implements the following: URL shortening with unique short codes Traffic splitting between two destination URLs Hit tracking per destination Computed total hit aggregation Password-protected admin dashboard React frontend served from the same backend service Deployment as a single Web Service on Render The backend uses: nanoid for generating short codes bcrypt for secure password validation An in-memory Map is used as a lightweight data store: const cache = new Map (); Each short code maps to an object containing metadata, two destination URLs, hit counters, and a c
Continue reading on Dev.to Tutorial
Opens in a new tab

