JDJyoti Dwivediinjs-learn-fun.hashnode.dev·Apr 29 · 6 min readStoring Uploaded Files and Serving Them in ExpressWhere Uploaded Files Are Stored When users upload files to your Node.js application, you must decide where to store them: 1. Local Storage (Server Filesystem) Files saved directly on the server's disk00
JDJyoti Dwivediinjs-learn-fun.hashnode.dev·Apr 29 · 6 min readSessions vs JWT vs Cookies: Understanding Authentication ApproachesWhat Are Sessions? Sessions are server-side storage mechanisms that maintain user state across multiple requests. How sessions work: User logs in with credentials Server creates a session and stores00
JDJyoti Dwivediinjs-learn-fun.hashnode.dev·Apr 29 · 4 min readAsync Code in Node.js: Callbacks and PromisesWhy Async Code Exists in Node.js Node.js is single-threaded and non-blocking. When performing I/O operations like reading files, making HTTP requests, or querying databases, Node.js doesn't wait for t00
JDJyoti Dwivediinjs-learn-fun.hashnode.dev·Apr 24 · 4 min readSynchronous vs Asynchronous JavaScriptThe Coffee Shop Revelation Picture a coffee shop with one barista. Two ways to handle orders: Synchronous (Blocking): Customer 1 orders → Barista makes coffee → Hands it over Customer 2 orders → Bar00
JDJyoti Dwivediinjs-learn-fun.hashnode.dev·Apr 24 · 4 min readAsync/Await in JavaScript: Writing Cleaner Asynchronous CodeThe Callback Hell Escape Three months into my first job, I inherited this monstrosity: fetchUser(userId, function(user) { fetchPosts(user.id, function(posts) { fetchComments(posts[0].id, functio00