Skip to content
StackPractices

Tag: rest

Browse 34 practical software engineering resources tagged with "rest". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving rest.

Create API Documentation with OpenAPI

Generate interactive API docs from OpenAPI specs using Swagger UI, Redoc, and native tools in Python, JavaScript, and Java.

Implement API Logging and Audit Trails

Set up thorough request/response logging and audit trails for APIs with structured output, correlation IDs, and compliance considerations.

Implement API Rate Limiting with Redis

Protect APIs from abuse using token bucket and sliding window algorithms with Redis, including burst handling, distributed coordination, and custom headers for client feedback

API Versioning

How to version REST and GraphQL APIs to maintain backward compatibility while evolving your interface.

Call a REST API

How to make HTTP requests to a REST API and handle the JSON response in multiple languages.

Cursor-Based Pagination with PostgreSQL

Implement efficient cursor-based pagination for large datasets in PostgreSQL, avoiding OFFSET performance degradation with indexed keyset pagination and stable sort ordering

Express.js Middleware Composition Patterns

Build maintainable Express applications using middleware composition patterns for authentication, validation, error handling, request context propagation, and async route wrappers

Go REST API with Gin and Middleware

Build production-ready REST APIs in Go using the Gin framework with custom middleware for logging, authentication, validation, and error handling

Implement a GraphQL API

Build a production-ready GraphQL API with type-safe schemas, resolvers, and query optimization in Python, JavaScript, and Java.

Build a GraphQL API with Apollo Server and TypeScript

How to build a production-ready GraphQL API using Apollo Server, TypeScript, and DataLoader to solve the N+1 query problem

Implement a gRPC API with Protocol Buffers

How to implement a gRPC API using Protocol Buffers for high-performance service-to-service communication

gRPC Services with Protocol Buffers in TypeScript

Build high-performance, strongly-typed services using gRPC with Protocol Buffers, covering unary calls, server streaming, client streaming, and bidirectional streaming

Handle CORS Correctly

How to configure Cross-Origin Resource Sharing (CORS) headers correctly for APIs, SPAs, and serverless functions without opening security holes.

Handle Errors in APIs

Patterns for consistent, predictable API error handling across multiple languages and frameworks.

Idempotent API Endpoints

How to design and implement idempotent API endpoints that safely handle retries, duplicate requests, and network failures without side effects.

Input Validation

How to validate user input safely using schemas, type checking, and sanitization across Python, JavaScript, and Java.

Logging

How to implement structured, level-based logging across Python, JavaScript, and Java with what works for production observability.

Middleware

How to implement request/response middleware for logging, auth, and error handling across Python, JavaScript, and Java.

Configure Nginx as a Reverse Proxy and API Gateway

How to use Nginx as a reverse proxy for backend services, implement load balancing, SSL termination, and rate limiting for production API gateways

Pagination

How to implement cursor-based and offset-based pagination in APIs and databases across Python, JavaScript, and SQL.

Rate Limiting

How to implement API rate limiting using token bucket, sliding window, and fixed window algorithms across Python, JavaScript, and Java.

Build Real-Time Notifications with WebSockets

Implement a real-time notification system using WebSockets and Redis pub/sub for broadcasting messages across clients.

REST API Design: What Works

Design reliable, scalable REST APIs with proper HTTP methods, status codes, versioning, and pagination strategies.

Send Emails with SMTP

How to send transactional and bulk emails securely using SMTP with template support.

Server-Sent Events (SSE)

How to implement one-way real-time streaming from server to browser using Server-Sent Events, with reconnection, event types, and multi-client broadcasting.

Implement Server-Sent Events in Go for Real-Time Updates

How to build a production-ready Server-Sent Events endpoint in Go with connection management, heartbeat pings, and graceful client disconnect handling

Webhooks

How to create and consume webhook endpoints for real-time event-driven integrations.

WebSocket Server

How to build a WebSocket server for bidirectional real-time communication, with connection management, message broadcasting, and heartbeat keepalive.

API Error Handling Guideline

A guideline for standardizing error responses, status codes, and error payloads across REST and GraphQL APIs.

API Documentation Template

A reusable template for documenting REST and GraphQL APIs with endpoints, schemas, errors, and examples.

Complete Guide to API Versioning Strategies

Version REST and GraphQL APIs with URI, header, query param, and content negotiation strategies. Covers deprecation, sunset, and migration patterns.

REST API Design Guide

A thorough guide to designing clean, scalable, and maintainable REST APIs.

Complete Guide to Microservices Communication

Compare sync vs async communication patterns for microservices. Covers REST, gRPC, message queues, event-driven, service mesh, and when to use each.

GraphQL vs REST — When to Choose and How to Migrate

A decision guide comparing GraphQL and REST APIs: use cases, performance, caching, tooling, and migration strategies for engineering teams.