0
0
Node.jsframework~5 mins

API versioning strategies in Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is API versioning and why is it important?
API versioning is a way to manage changes in an API over time. It helps keep old clients working while allowing new features or fixes in newer versions.
Click to reveal answer
beginner
Name three common API versioning strategies.
1. URI versioning (e.g., /v1/resource)<br>2. Query parameter versioning (e.g., /resource?version=1)<br>3. Header versioning (using custom headers like 'Accept-Version')
Click to reveal answer
beginner
How does URI versioning work in an API?
URI versioning adds the version number directly in the URL path, like /api/v1/users. This makes it clear and easy to route requests to the right version.
Click to reveal answer
intermediate
What is a benefit of using header versioning over URI versioning?
Header versioning keeps URLs clean and lets clients specify the version in request headers, which can be more flexible and hides version details from the URL.
Click to reveal answer
intermediate
What is a drawback of query parameter versioning?
Query parameter versioning can be less visible and sometimes caching systems might ignore query parameters, causing unexpected behavior.
Click to reveal answer
Which API versioning strategy places the version number in the URL path?
AQuery parameter versioning
BHeader versioning
CURI versioning
DContent negotiation
What header might be used for header-based API versioning?
AAccept-Version
BContent-Type
CAuthorization
DUser-Agent
Which versioning strategy can cause issues with caching if not handled properly?
AURI versioning
BQuery parameter versioning
CHeader versioning
DNo versioning
Why is API versioning important?
ATo avoid documentation
BTo break all old clients
CTo make URLs longer
DTo allow changes without breaking existing clients
Which versioning method keeps URLs clean and hides version info from the URL?
AHeader versioning
BQuery parameter versioning
CURI versioning
DNo versioning
Explain three common API versioning strategies and when you might use each.
Think about how the version appears in the request and what clients see.
You got /4 concepts.
    Describe why API versioning is necessary and what problems it solves.
    Imagine you change your app but some users still use the old one.
    You got /4 concepts.