You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A requested version from the client must be available on the request object at `req.version`.
90
-
You are encouraged to use this module's twin: [express-version-request](https://github.com/lirantal/express-version-request) which is another simple ExpressJS middleware that populates `req.version` from the client's X-Api-Version header, Accept header or from a query string (such as 'api-version=1.0.0')
90
+
You are encouraged to use this module's twin: [express-version-request](https://github.com/lirantal/express-version-request) which is another simple Express middleware that populates `req.version` from the client's X-Api-Version header, Accept header or from a query string (such as 'api-version=1.0.0')
91
91
92
92
The key for the routes versions you define can be a non-semver format, for example: `1.0` or just `1`. Under the hood, `expression-version-route` uses the `semver` module to check if the version found on the request object at `req.version` matches the route.
93
93
@@ -98,7 +98,7 @@ The key for the routes versions you define can be a non-semver format, for examp
2. The `express-version-request` library will parse the `X-Api-Version` and sets ExpressJS's `req.version` property to 1.0.0.
101
+
2. The `express-version-request` library will parse the `X-Api-Version` and sets Express's `req.version` property to 1.0.0.
102
102
3. The `express-version-route` library, when implemented like the usage example above will match the 1.0 route version because semver will match 1.0.0 to 1.0, and then reply with the JSON payload `{'message': 'hello to you version 1.0'}`.
103
103
104
104
@@ -162,7 +162,7 @@ Upgrading APIs with some breaking change would lead to breaking existing product
162
162
163
163
## Alternative Node.js libraries
164
164
165
-
Several npm projects exist which provide similar API versioning capabilities to ExpressJS projects, and I have even contributed Pull Requests to some of them that provide fixes or extra functionality but unfortunately they all seem to be unmaintained, or buggy.
165
+
Several npm projects exist which provide similar API versioning capabilities to Express projects, and I have even contributed Pull Requests to some of them that provide fixes or extra functionality but unfortunately they all seem to be unmaintained, or buggy.
0 commit comments