Backend
36 bites tagged Backend — interview questions with model answers, and 60-second explainers.
Express Middleware: The Chain of Command for Requests
Express middleware is a chain of functions a request passes through. Each function can inspect, modify, or stop the request, useful for logging, auth, or body parsing.
Express Request and Response Objects (req, res)
Think of Express's `req` and `res` as an incoming letter and your reply. `req` contains the client's request details, like headers and data, while `res` is your toolkit for sending a response. They are the core of every route handler.
Express.js: Basic Request Routing
Express routing connects a request's path and HTTP method (like GET `/`) to a specific handler function. This is the core of any Express app, used to define API endpoints or handle form submissions. A common mistake is using the wrong method for a request.
Creating Your First Express Server
Think of an Express app as three steps: require the library, create an instance, and listen on a port. This is the foundation for any Express-based API or web server.
path.join() vs. path.resolve(): Concatenation vs. Calculation
path.join() glues path segments together, while path.resolve() calculates an absolute path. Think string building vs. `cd` commands. Use join for relative paths and resolve for absolute ones.
Creating a Basic HTTP Server in Node.js
A Node.js HTTP server is a listening post that waits for requests on a port and runs your code to reply. It's the foundation for any web service, from simple APIs to full apps. The footgun: forgetting `response.end()` leaves the client hanging indefinitely.
Structuring Express Apps with Layered Architecture
Think of your Express app as a three-story building: a web layer for HTTP traffic, a service layer for business logic, and a data layer for your database. This keeps code organized and testable.
Workflow Engine: The Conductor for Your Business Logic
A workflow engine conducts your business logic, ensuring complex tasks run in the right order. It's for multi-step processes like order fulfillment or data pipelines. The footgun is building one from scratch—you'll poorly reinvent state management and retries.
App Store Server Notifications: Your Backend's Source of Truth
App Store Server Notifications are webhooks from Apple that tell your backend about subscription events like renewals or refunds. They are your server's source of truth for user entitlements, letting you grant or revoke access without relying on the client…
Server-Side Experimentation: Testing Your Backend Logic
Server-side experimentation renders A/B test variations on the server before sending the page. Use it for testing deep backend logic like search algorithms or to avoid the visual 'flicker' of client-side tests. The footgun: it requires developer cycles.
Go's `net/http`: A Production-Ready Web Server
Go's `net/http` package provides a powerful, production-ready web server without external frameworks. You build services by creating handlers—functions that process a request and write a response. It's ideal for APIs and microservices.
API Authentication: Who Goes There?
API authentication is the bouncer at your application's door, checking IDs to prove who is making a request. It's used to protect any networked service, from weather data to banking.
Get Backend bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.