Skip to content

Commit 5e96a40

Browse files
committed
docs: update logo and Express name
1 parent 938080d commit 5e96a40

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.github/api-server.js.png

-302 KB
Binary file not shown.

.github/express-version-route.png

353 KB
Loading

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111

1212
[![express-version-route](https://snyk.io/advisor/npm-package/express-version-route/badge.svg)](https://snyk.io/advisor/npm-package/express-version-route)
1313

14-
This npm package provides an ExpressJS middleware to load route controllers based on api versions.
14+
This npm package provides an Express middleware to load route controllers based on api versions.
1515

16-
Implementing API Versioning in 15 lines of code:
16+
Implementing API Versioning as simple as:
1717

18-
![](https://pbs.twimg.com/media/DDcLgNQXkAARLIX.jpg:small)
18+
![](.github/express-version-route.png)
1919

2020
now any request would be handled with the appropriate route handler in accordance to `request.version`.
2121

2222
## Usage
2323

24-
Create a map where the key is the version of the supported controller, and the value is a regular ExpressJS route function signature.
24+
Create a map where the key is the version of the supported controller, and the value is a regular Express route function signature.
2525

2626
```js
2727
const versionRouter = require('express-version-route')
@@ -87,7 +87,7 @@ router.get('/test', versionRouter.route(routesMap))
8787
### The Library
8888

8989
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')
9191

9292
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.
9393

@@ -98,7 +98,7 @@ The key for the routes versions you define can be a non-semver format, for examp
9898
curl --header "X-Api-Version: 1.0.0" https://www.example.com/api/users
9999
```
100100

101-
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.
102102
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'}`.
103103

104104

@@ -162,7 +162,7 @@ Upgrading APIs with some breaking change would lead to breaking existing product
162162

163163
## Alternative Node.js libraries
164164

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.
166166

167167
* https://github.com/Prasanna-sr/express-routes-versioning
168168
* https://github.com/elliotttf/express-versioned-routes

0 commit comments

Comments
 (0)