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
Copy file name to clipboardExpand all lines: Readme.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ It is written in Javascript ES6 syntax and it is further transpiled down to Java
29
29
app.use(expressApiVersioning({
30
30
instance: app, // passes an instance of express to the entry point
31
31
apiPath:path.join(__dirname, './api'), // absolute path to the api directory
32
-
test:/\/api\/(v[0-9]+)[a-z0-9/_+-]*/, // regular expression to get the version number from the url
32
+
test:/\/api\/(v[0-9]+).*/, // regular expression to get the version number from the url
33
33
entryPoint:'app.js'// entry point exports a function which takes an instance of express as parameter.
34
34
}));
35
35
```
@@ -39,7 +39,7 @@ app.use(expressApiVersioning({
39
39
app.use(expressApiVersioning({
40
40
instance: app, // passes an instance of express to the entry point
41
41
apiPath:path.join(__dirname, './api'), // absolute path to the api directory
42
-
test:/\/endpoint\/(v[0-9]+)[a-z0-9/_+-]*/, // regular expression to get the version number from the url,
42
+
test:/\/endpoint\/(v[0-9]+).*/, // regular expression to get the version number from the url,
43
43
entryPoint:'index.js'// entry point exports a function which takes an instance of express as parameter.
44
44
}));
45
45
```
@@ -62,7 +62,7 @@ Please use the [issues](/issues) page to report an issue.
62
62
63
63
| Configuration item | Default | Description |
64
64
| ------ | ------ | ------- |
65
-
| test | /\/api\/(v[0-9]+)[a-z0-9/_+-]*/| Regular expression to get the version number from the request url. It gets the version number from the first group of the regex match.
65
+
| test | `/\/api\/(v[0-9]+)[a-z0-9/_+-]*/`| Regular expression to get the version number from the request url. It gets the version number from the first group of the regex match.
66
66
| entryPoint | app.js | Entry point for each api version. It exports a function which takes an instance of express as parameter.
67
67
| apiPath | empty string | Absolute path to each api version container/directory. This is usually `path.join(__dirname, './api')`.
68
68
| instance | null | An instance of express app which will be passed down to the entry point for usage.
@@ -77,7 +77,7 @@ Please use the [issues](/issues) page to report an issue.
77
77
78
78
# Testing
79
79
80
-
If you will like to test this package,
80
+
To test this package,
81
81
- Clone this repo or `npm install express-api-versioning`
82
82
- cd into the package directory and run `npm install`
Copy file name to clipboardExpand all lines: package.json
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "express-api-versioning",
3
-
"version": "1.0.0",
3
+
"version": "1.0.2",
4
4
"description": "Express API versioning is an express middleware that dynamically loads different API versions seamlessly depending on the version number specified in the request url.",
0 commit comments