API
114 bites tagged API — interview questions with model answers, and 60-second explainers.
CORS Middleware: Unlocking Cross-Origin Requests in Express
The `cors` middleware tells browsers which external websites can read your Express API's responses. Use it when a frontend on one domain needs to fetch data from your API on another.
WHATWG URL API: Safely Parse URLs, Not Strings
Treat URLs as structured objects, not messy strings. The WHATWG URL API parses a URL into components like protocol and path, just like JSON.parse. Use it for incoming requests or outgoing API calls. The footgun is using the legacy `url.parse()`.
Rate Limiting: Your API's Bouncer
Rate limiting acts as a bouncer for your API, controlling traffic to protect your service. It's used on public APIs to prevent abuse, ensure fair usage, and defend against denial-of-service attacks.
OpenTelemetry API: The Stable Interface for Your Code
The OpenTelemetry API provides stable interfaces for your code to generate telemetry. This lets you instrument your application once, while the SDK implementation handles the actual data processing and export, which can be swapped out later.
Model Signature: The API Contract for Your ML Model
A model signature is an API contract for your ML model, defining the exact shape and types of its inputs, outputs, and parameters. It's used by platforms like MLflow to validate requests and enable safe deployments. Forgetting it will block model registration.
Amazon Bedrock: One API for Many AI Models
Amazon Bedrock is an API gateway for foundation models, letting you switch AI providers without rewriting code. It's used to build generative AI apps while avoiding vendor lock-in.
MaaS: Renting AI Brains via API
Model-as-a-Service (MaaS) is like renting a pre-trained AI expert via an API. Instead of building and training your own models, you pay to use powerful, ready-made ones for tasks like text generation or image analysis.
The OpenAI API: Access to Foundational AI Models
The OpenAI API provides access to influential models like GPT and DALL-E. It enables developers to integrate generative AI into commercial applications and research, building on technology that catalyzed the current AI boom.
The FromRequest Trait: Consuming Request Bodies in Axum
Axum's `FromRequest` trait defines how to create a type by consuming an HTTP request body. It's the core of extractors like `Json<T>` that deserialize POST data. The footgun: you can only use one `FromRequest` extractor per handler, as it consumes the body.
Dart's `http` Package: Simple Requests vs. Composable Clients
Dart's `http` package simplifies web requests. Use top-level functions like `http.get()` for one-off calls, or a `Client` for persistent connections. Forgetting to call `client.close()` is a common footgun that leaks resources.
Kubernetes Gateway API: The Successor to Ingress
The Gateway API replaces Kubernetes Ingress with a role-oriented model, separating infrastructure from application routing. Use it when different teams need to manage their own traffic rules.
kube-apiserver: The Front Door to Your Kubernetes Cluster
The kube-apiserver is the front door to your Kubernetes control plane. All requests to query or modify the cluster's state must pass through it, from `kubectl` commands to automated controller actions. The footgun is bypassing it to modify `etcd` directly.
Kubernetes API Aggregation Layer: Extending the API Server
The API Aggregation Layer bolts custom API servers onto the main Kubernetes API, with `kube-apiserver` acting as a proxy. This powers features like the metrics server (`kubectl top`) and enables complex extensions.
Custom Resource Definitions (CRDs): Teach Kubernetes New Tricks
CRDs let you define your own resource types, teaching Kubernetes new nouns like `Database` or `Backup`. This is how operators manage complex apps declaratively. The footgun is that a CRD only defines the API; you still need a controller to act on the objects.
Kubernetes Events: The Cluster's Short-Term Memory
Think of Kubernetes Events as a cluster's temporary log, recording state changes like a Pod starting or a container failing. Use them with `kubectl describe` to debug issues in real-time.
Kubernetes API Server Authorization Modules
Kubernetes API server authorization is like a chain of security guards. A request must get a "yes" from at least one configured module (like RBAC) to pass. This is fundamental to securing any cluster. The footgun is that the chain stops at the first "allow."
K8s Authentication: Proving Who You Are to the API Server
The K8s API Server is a vault door; authentication is proving your identity to the guard. It tries a chain of methods—like OIDC for users or tokens for pods—until one succeeds. The footgun: unauthenticated requests become `system:anonymous`, a major risk.
Kubernetes Admission Controllers: The API's Gatekeepers
Think of admission controllers as bouncers for your Kubernetes API. They intercept requests before objects are saved, enforcing custom policies like security rules or required labels. The footgun: a broken controller can block all changes to your cluster.
Figma's Library Analytics API: Quantify Your Design System's Impact
Figma's Library Analytics API lets you quantify your design system's impact by tracking component usage. Use it to find adoption trends or get a snapshot of where components are used. The footgun: data for files you can't access is obfuscated, not omitted.
Semantic Versioning: The MAJOR.MINOR.PATCH Contract
Semantic Versioning (MAJOR.MINOR.PATCH) is a contract that tells users if an update will break their code. It's used by package managers to safely resolve dependencies.
Semantic Versioning: A Contract for Your Code's Evolution
Semantic Versioning is a contract for your code. The MAJOR.MINOR.PATCH format signals if an update is a breaking change, a new feature, or a bug fix. It's vital for managing dependencies safely. The footgun: SemVer is meaningless without a defined public API.
SQL Query Builders: Write SQL Without Writing SQL
An SQL query builder is a translator for your database, converting visual clicks or chained code methods into raw SQL. It's used to write safer, database-agnostic code or to let non-technical users build queries. The footgun is generating inefficient queries.
ODBC: The Universal Translator for Databases
ODBC acts as a universal translator, letting one application speak to many different relational databases. Your app uses the standard ODBC interface, and a specific "driver" handles the unique protocol for each database. The footgun is performance overhead.
JDBC: Java's Universal Translator for Databases
JDBC is Java's universal adapter for databases, letting your app speak SQL to any database via a standard API. It's used for connecting, querying, and managing transactions. The biggest footgun is building SQL strings directly; always use PreparedStatements.
Get API bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.